You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a recent support topic, a user reported their wp_options table growing to 12GB and making queries very slow. Apparently this is due to transients being stored by the AMP plugin, in particular those for parsed stylesheets. A lot of work has been invested into mitigating this problem (#2092) by monitoring the average number of transients being generated over time period and disabling transient caching if the number goes above a given threshold (#4177). Apparently this is not working for the user who opened the support topic, as I can't imagine 12GB would not exceed the threshold in MonitorCssTransientCaching.
I have an idea to compliment MonitorCssTransientCaching as an additional safeguard. What if it not only detected the number of new transients being created each day, but if it also looked at the total number of transients stored for parsed stylesheets? If that number is ridiculously large (like 10,000) then we should consider disabling parsed CSS transient caching in this case as well.
Additionally, along with obtaining the current number of transients being stored, this background task can also proactively delete the transients for older versions of the plugin. Currently when the $cache_group is changed from say amp-parsed-stylesheet-v30 to amp-parsed-stylesheet-v31, all of the transients for amp-parsed-stylesheet-v30 will remain in the DB for up to a month. If there are multiple releases of the AMP plugin in a month, then this could result in the same parsed stylesheets being stored in multiple versions concurrently, even though we only need the most recent version. When the $cache_group is bumped in this case, all transients that have a name prefixed by amp-parsed-stylesheet-v30 can just be straight up deleted.
Putting in place a max transient count and proactively purging old versions of transients should guard against the database getting filled up and slowing down the site.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered:
On a parsed CSS version bump, we should delete old transients. Otherwise, with each version bump we will double the number of transients until they expire.
Feature description
In a recent support topic, a user reported their
wp_options
table growing to 12GB and making queries very slow. Apparently this is due to transients being stored by the AMP plugin, in particular those for parsed stylesheets. A lot of work has been invested into mitigating this problem (#2092) by monitoring the average number of transients being generated over time period and disabling transient caching if the number goes above a given threshold (#4177). Apparently this is not working for the user who opened the support topic, as I can't imagine 12GB would not exceed the threshold inMonitorCssTransientCaching
.I have an idea to compliment
MonitorCssTransientCaching
as an additional safeguard. What if it not only detected the number of new transients being created each day, but if it also looked at the total number of transients stored for parsed stylesheets? If that number is ridiculously large (like 10,000) then we should consider disabling parsed CSS transient caching in this case as well.Additionally, along with obtaining the current number of transients being stored, this background task can also proactively delete the transients for older versions of the plugin. Currently when the
$cache_group
is changed from sayamp-parsed-stylesheet-v30
toamp-parsed-stylesheet-v31
, all of the transients foramp-parsed-stylesheet-v30
will remain in the DB for up to a month. If there are multiple releases of the AMP plugin in a month, then this could result in the same parsed stylesheets being stored in multiple versions concurrently, even though we only need the most recent version. When the$cache_group
is bumped in this case, all transients that have a name prefixed byamp-parsed-stylesheet-v30
can just be straight up deleted.Putting in place a max transient count and proactively purging old versions of transients should guard against the database getting filled up and slowing down the site.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: