Open szepeviktor opened 10 years ago
As soon as I click "Clear Pods Cache" it goes down from 700k to 150k. But after navigating on dashboard it is 500k again.
I'm getting this too; the tech at WP Engine thought large autoloaded options were the root cause of 502 errors we were getting.
I'm wondering, do they really need to be autoloaded?
If it helps, here's the SQL command I used to see them:
SELECT LENGTH(option_value),option_name FROM wp_options WHERE autoload='yes' AND option_name LIKE '%_transient_pods%' ORDER BY length(option_value) DESC LIMIT 1000;
And here are the top 10 -- the length and the name of the transient.
492641 _transient_pods_pods_wppod_tableinfo_media-2.6.7 231919 _transient_pods_pods_nofields_get_all-2.6.7 210424 _transient_pods_pods_get_type_pod_table-2.6.7 210424 _transient_pods_pods_nofields_get_type_pod-2.6.7 210424 _transient_pods_pods_get_type_pod-2.6.7 128907 _transient_pods_pods_wppod_tableinfo_media_post-... 111706 _transient_pods_b4e62f2e4a7c409023a00c89002ebd40 111706 _transient_pods_3247fc23f1a58d9758e0e5a3c024ad61 111706 _transient_pods_dc30f9a3401f5f981c93cf8a99bf501e 111706 _transient_pods_6b565c6f2de41c87beda45341e38b605 110978 _transient_pods_pods_wp__pod_media-2.6.7
If you use a memory based object cache (Redis, Memcached) there will be no transients in the DB, and there will be no load-everything-at-start event.
Thanks, I'll look into it!
I think WP Engine uses not-so-fast Linode instances, see https://github.com/szepeviktor/wordpress-speedtest
WP Engine does indeed use Linode.
Hi, I'm also have this same issue. I've recently moved my site to wpengine, and I started experiencing some 502 errors. The support people did some investigating and pointed to my Pods autoload as a possible culprit. I have a number of pods and a good deal of data in them, but I don't need it all autoloaded. Looking for your advice to reduce the load.
[8:02]
Here are the details: Looking into your intermittent 502's on the site, I am seeing a high count in autoloaded data:
Top largest autoload rows over 1000 bytes: mysql> SELECT LENGTH(option_value),option_name FROM wp_options WHERE autoload='yes' ORDER BY length(option_value) DESC LIMIT 20;
741311 _transient_pods_4f8840a754d0b4874e4aa1e5817c0b44 621499 _transient_pods_pods_get_type_post_type-2.6.7 332096 _transient_pods_pods_wppod_tableinfo_employee-2.6.7 309470 _transient_pods_pods_wppod_application-2.6.7 156574 _transient_pods_pods_wppod_assessment-2.6.7 122932 _transient_pods_pods_wppod_tableinfo_company-2.6.7 120704 _transient_pods_pods_wppod_tableinfo_portfolio-2.6.7 103580 _transient_pods_7fc870bc87fe8a76d885dfea6bfa9ba6 103580 _transient_pods_4edfca2c5ec79164d670fee8079f29ae 98250 _transient_pods_72b18d04cdc52e1a9cc6bc067abc7efd 98250 _transient_pods_7250cadfdc11c4d5d59e44165b52853d 98002 _transient_pods_pods_wppod_tableinfo_user-2.6.7 93778 _transient_pods_pods_get_type_user-2.6.7 93765 _transient_pods_pods_wppod_user-2.6.7 90466 _transient_pods_pods_wppod_company-2.6.7 44432 CF57d1e4537a120 42097 CF57d84adf88621 30454 _transient_pods_pods_wp__pod_employee-2.6.7 28812 _transient_pods_5509568ca7fb2faae5545bb423b9a682 25957 CF57bb833d8312b
Total autoloaded data (in bytes): mysql> SELECT SUM(LENGTH(option_value)) FROM wp_options WHERE autoload = 'yes';
4,464,630 This looks to be coming from your pods plugin, and I would recommend disabling the plugin to see if you are noticing those 502's disappear.
I was going to enable the WP Engine object cache, but then I saw a note (https://wpengine.com/support/wp-engines-object-caching/) about that causing problems when there is a large amount of autoloaded data, as the object cache stores it as one long row, and as you can see above, PODS is yielding an autoload of ~ 4MB
Is there a way to eliminate the PODS autoload? Not sure why that is needed. Any suggestions appreciated!
Is there a way to eliminate the PODS autoload?
Try adding memory-based object cache. (PECL) Redis is my top choice https://github.com/pantheon-systems/wp-redis
Convince WP Engine people to install it for you. Nice GUI: erik-dubbelboer/php-redis-admin
If you're using WPEngine, you should activate Pods Alternative Cache. It was built for cases where object cache sizes may be limited (or object caching is unavailable) on a hosting plan. For large Pods installations with tons hundreds of Pods and fields, having them all stored in the object cache can cause the object cache itself to become ineffective since it constantly runs out of space and trashes our objects (or other useful cached objects from WordPress, the theme, or plugins).
Thanks, Scott, I will do that.
@sc0ttkclark Can this be closed?
Good job @szepeviktor you discovered this issue almost 7 years before me :+1:
I just started looking at this on my site 3 months ago https://podswp.slack.com/archives/C02SWND14/p1585569795000300?thread_ts=1584711207.043300&cid=C02SWND14 when looking through wp doctor
command autoload check diagnosis.
On our site there's a massive difference: Pods items alone balloon auto(pay)load from 600 kB -> 4.5 MB.
We're already using Redis, but these transients periodically somehow make their way back into options table. I haven't found out yet how to keep them out consistently. Any ideas?
I think this needs work.
For step 1, perhaps we could review individual transient JSON content for size reduction opportunities - remove all empty value keys etc.
Big transient JSON example:
These are the autoload option sizes. I only use custom post types and some fields. Could this query be smaller?