"Consider talking about autoload and Memcached" / "can we move this to an issue and get rid of inline TODO comments?"
Discuss wp_optionsautoload setting. Considerations on performance (query time) and memory use (PHP and object cache memory limits vs. MySQL longtext memory limits)
With object cache (memcached, redis, APCu, etc.), wp_load_alloptions() should persist data across page loads.
This speeds access, but Object Cache memory limits must be scaled or taken into consideration. For example, memcached may place a 1MB limit on individual values, but wp_options> value is longtext, which may contain values up to 4GBstackexchangewp-admin/includes/schema.php#L144MySQL longtext
Hosts: Consider maximum memory available for all combined options.
Total autoload size can be checked with SELECT SUM(LENGTH(option_value)) as autoload_size FROM wp_options WHERE autoload='yes';kinsta.com
Developers: Consider benefits of having options cached by default (no additional SQL queries), vs. loading values into RAM on all page loads. Is the value likely to be used on every page load? If not — it may be fine to set autoload to false, allowing the value to be cached by MySQL, another cache, etc.
Re: https://github.com/ataylorme/WordPress-Hosting-Best-Practices-Documentation/pull/35#discussion_r201106099
Discuss
wp_options
autoload
setting. Considerations on performance (query time) and memory use (PHP and object cache memory limits vs. MySQL longtext memory limits)For example:
autoload
defaults toyes
|true
autoload
isyes
, wp_load_alloptions() loads these values into memory, either from MySQL or from object cachewp_options
, loading allautoload
options into memory from MySQL.memcached
,redis
,APCu
, etc.),wp_load_alloptions()
should persist data across page loads.memcached
may place a1MB
limit on individual values, butwp_options
>value
islongtext
, which may contain values up to4GB
stackexchange wp-admin/includes/schema.php#L144 MySQL longtextSELECT SUM(LENGTH(option_value)) as autoload_size FROM wp_options WHERE autoload='yes';
kinsta.comautoload
to false, allowing the value to be cached by MySQL, another cache, etc.