-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Opt out of Project Config #4459
Comments
FWIW, I've noticed a pretty noticeable slowdown in editing fields, and sounds like this might be the issue. I'm not sure how practical this is, as most things seem to be routed through project config, but I'd certainly be keen for this. |
It would be next to impossible to make the whole thing optional; anything that currently supports project config would need to start accounting for both scenarios. That said there is likely room for improvement in how the config gets stored, so it’s more scalable to larger sites. Do either of you have a particularly painful example you’d be able to share with us? If so send the |
Is there any particular reason the project config is |
FWIW, I find myself generally frustrated with not being able to see simple things in the database any longer too. I often enable Project Config locally to tweak things on projects where we choose not to use it for the overall workflow. But it mostly just makes me feel like I need to take extra steps to accomplish simple things or get simple information while troubleshooting or testing in development. |
The reason is that a JSON value in the database would be tempting to some people to "just modify this one little bit, because it's faster to do by hand". Modifying that by hand could lead to a support ticket where we have no clear way of figuring out what went wrong. A serialized value is a pretty good deterrent for that. |
@brandonkelly I submitted some logs to P&T via
I can discuss with the client about getting you a db dump but it should be okay. |
Andris, what you said here really made my ears prick up – an expression I hope goes with your over-the-top excellent English…
I must reflect that I’ve stayed strictly away from Project Config, at least until it doesn’t generate a constant stream of issues, and yet its presence has already caused a few ‘blind’ hiccups when it didn’t like something I did during development. But it seems mainly that this is a tool strictly for large-public-view, heavily managed sites, and is more likely to be just a bother for less intense ones, as Ben for one indicates.
The performance issue surfacing is one argument surely in that direction, and too bad if Brandon’s present take on this seems to mitigate decoupling/optioning it for lighter-weight Craft uses.
But when I saw this about avoiding efficiency in order to trap rogue editors of internals, well…
If you really care this way, and I can actually appreciate the dynamics, if it reads a bit like counter-tricks in an espionage novel, why not just light-weight encrypt the JSON others suggest, which would give you a blob sufficiently impenetrable for purpose, would seem?
Doesn’t feel it would take many cpu cycles of such mangling to discourage edits other than in the Yaml where you want it?
Best,
Clive
From: Andris Sevcenko
Sent: Friday, June 28, 2019 10:09 AM
To: craftcms/cms
Cc: Subscribed
Subject: Re: [craftcms/cms] [FR] Opt out of Project Config (#4459)
Is there any particular reason the project config is serialized vs json_encoded? It doesn't seem like any full classes are being serialized, only array/object data. It would seem that PHP serialization typically takes additional computational effort and storage space.
The reason is that a JSON value in the database would be tempting to some people to "just modify this one little bit, because it's faster to do by hand". Modifying that by hand could lead to a support ticket where we have no clear way of figuring out what went wrong.
A serialized value is a pretty good deterrent for that.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
We just profiled saving a field before and after switching to JSON-encoding the config, and saw a 5.2x performance gain, so yeah, that settles that. Swapped to JSON for Craft 3.1.33 and 3.2.0-RC3. To get the fix early, change your "require": {
"craftcms/cms": "dev-develop#6525f43f86357d32ebd0bb4838217a9ec223a24e as 3.1.32",
"craftcms/cms": "3.2.x-dev#3449e30688d06d64e85017d9db7861c3635a029f as 3.2.0-RC2",
"...": "..."
} Then run There’s still likely some room for improvement, so going to leave this open. For 3.3 we are going to look into storing the project config in its own |
Just totally cool, @brandonkelly!
…On Fri, Jun 28, 2019, 14:46 Brandon Kelly ***@***.***> wrote:
We just profiled saving a field before and after switching to
JSON-encoding the config, and saw a 5.2x performance gain, so yeah, that
settles that.
Swapped to JSON for Craft 3.1.33 and 3.2.0-RC3.
To get the fix early, change your craftcms/cms requirement in
composer.json to one of these, depending on whether you’re running Craft
3.1 or the 3.2 RC:
"require": {
"craftcms/cms": "dev-develop#6525f43f86357d32ebd0bb4838217a9ec223a24e as 3.1.32",
"craftcms/cms": "3.2.x-dev#3449e30688d06d64e85017d9db7861c3635a029f as 3.2.0-RC2",
"...": "..."
}
Then run composer update.
There’s still likely some room for improvement, so going to leave this
open. For 3.3 we are going to look into storing the project config in its
own config table with path and value columns so we only need to update
the things that changed, and keep the full config stored in cache.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4459?email_source=notifications&email_token=AAB4RCPU3KG72S7HJA3TZ7LP42BERA5CNFSM4H4CJML2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY3HURQ#issuecomment-506886726>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB4RCKIPAVIOBVUFOP3GDTP42BERANCNFSM4H4CJMLQ>
.
|
So this is definitely an improvement @brandonkelly -- in local dev, I'm able to save a new Text field in a Matrix block in It's also generating 504.8 MB in log files spanning 6
I believe the error, and at least part of the slowdown is from logging. Here's a partial fragment of the query log:
Due to the number of fields, it's trying to log a gargantuan amount of data here, and finally gives up. |
If it's helpful... this site has 252 fields, many of which are Matrix fields that contain sub-fields, often SuperTable fields... which then have their own fields. So there's probably more config data than normal for just 252 straight up fields. |
@khalwat i'm assuming that's with devMode enabled, correct? Out of curiosity, what sort of numbers do you see with it disabled? |
Correct @angrybrad -- I will try it without |
With
And in the
...which is odd, and makes me wonder if something else is afoot here as well. It does complete adding the field successfully, however. |
@khalwat Could you share the byte size of your |
@Mosnar So it looks like it's actually not that large in the db:
about
|
Not sure if it's related, but I'm experiencing the same issue as @khalwat with slow save-times when adding new fields to a matrix (30sec+). |
@nettum Thanks for pointing that out! Just fixed that for the next release. Guessing that will drastically improve your site’s performance as well @khalwat. To get the fix early, change your "require": {
"craftcms/cms": "dev-develop#048388f4243e5451e0b2c203cd556c04130fdb8f as 3.1.32",
"craftcms/cms": "3.2.x-dev#64253d90ae56ac7a5d328e1a59c445cfee27d69a as 3.2.0-RC2",
"...": "..."
} Then run |
With devMode off and the latest build, it completes adding a new field in Also there is no Nice work @brandonkelly ! Will look forward to Project Config not being a big blob in the future, but this is a massive improvement! |
I'm glad I came across this thread. I'm in the middle of porting a site over from Expression Engine and it's starting to drive me crazy the time it's taking adding new fields in Craft! It's definitely taking longer and longer as I add more fields and like nothing I've ever experienced in EE. This is with devMode off on a production server. I'm also noticing a significant lag when loading related entries, I doubt that is related though. Hopefully the most recent update will improve things. |
For anyone reading this, the fix was rolled into Craft CMS 3.1.33 -> https://github.com/craftcms/cms/blob/develop/CHANGELOG-v3.md#3133---2019-07-02 |
6525f43 was a forward incompatible change with a minor version bump. If you rollback to 3.1.32.1 after running 3.1.33, you'll get |
@gregmartyn you should also be restoring the database if rolling back, since migrations (if any), cannot be reverted and, if there have been any DB schema changes, Craft, in general, will refuse to run. |
Sorry, I'm still new to Craft. This is surprising behavior to me. I'd expect at least the minor x.Y.z version to change when the database is incompatible. Migrations have degrees of compatibility, but a change like this where a table is rewritten in a different format that the previous patch-level version is incompatible with -- and affects all requests -- is pretty major. |
@gregmartyn We’ve never thought about it that way, but we’re in the process of working out a more formal release schedule & guidelines internally, and this is great feedback. I like the idea of ensuring that all patch release migrations (x.y.Z) should be revertable, and if that’s not possible, it should be held off until the next minor release (x.Y.0). And sorry about the inconvenience here. Is there a reason you are trying to revert in the first place? The migration you are referring to was a pretty significant performance improvement. |
We launched some code to production that had a minor bug in it. (It affected only the admin area) The launch also included upgrading the patch level of Craft. (x.y.Z) When we rolled back to the previously deployed Docker image of the site, the entire site went down. We were aware of the Craft version number change, but it wasn't immediately obvious that the two versions were incompatible. The version number change only suggested that the newer version might have some bugfixes, so it looked like our database data had been corrupted. (our bug was being triggered by other unrelated data missing) Even looking back at the Craft changelog now it's not obvious that there were changes to the database. A call out saying that there were db changes may have helped, but really it was the incompatibility of two patch x.y.Z releases that threw us off. Thanks for listening! |
If we're not using the
project.yaml
it'd be nice if we could opt out of Project Config.The reason is that numerous pieces of data that used to exist in relational database tables is now in a big serialized blob in the
info
table.If we start to get a large number of fields, the process of adding a new field is orders of magnitude slower than on Craft 3.0.x. And I have seen it result in making Craft unusable for adding new fields, resulting in PHP errors.
Additionally, just the logging of this massive blob as it is saved (with
devMode
on) causes severe slowdowns and PHP memory errors.The text was updated successfully, but these errors were encountered: