Opened 5 weeks ago
Last modified 9 days ago
#64854 new enhancement
Site Health: opcache full: need a Recommended Improvement notice.
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | trunk |
| Component: | Site Health | Keywords: | has-patch |
| Focuses: | performance, php-compatibility | Cc: |
Description (last modified by )
Please see #63697.
I've been doing some perf analysis and noticed this: every site I look at has the OPCache running at 100%. It seems WordPress has outgrown the OPcache, even on simple sites. Blowing it out and churning it is not good for site performance (obviously).
I respectfully suggest the Site Health test suite add a "Recommended improvement" item when it detects a full opcache or full interned strings buffer.
Here's a draft of code to do that. https://github.com/OllieJones/sqlite-object-cache/blob/35b64c333032322d188a7467d2d2c3758a1aebea/includes/lib/class-sqlite-object-cache-opcache.php
Attached is what my draft looks like in the Site Health panel.
Attachments (3)
Change History (10)
#1
@
5 weeks ago
I think this is a good idea and worth doing, but needs careful thresholds so Site Health does not become a drama llama. It's like the second half of #63697, but I'd like signal-quality over alarm-volume.
I like it because:
- WordPress now exposes opcache info in Site Health so surfacing “enabled but saturated” is the natural next step
- PHP exposes the bits needed to make this determination via
opcache_get_status()(including cache state and interned-strings usage) and the opcache config docs explicitly describe howopcache.memory_consumption,opcache.interned_strings_buffer, andopcache.max_accelerated_fileswork - If the cache or interned strings pool is pegged, the site is leaving performance on the table and may churn more than it should; the PHP docs’ recommended defaults are pretty thin and WordPress can easily be wider than those
“100% full” may be too blunt by itself? A full'ish opcache is not automatically unhealthy:
cache_full/ restart pressure- interned strings free memory near zero
- key exhaustion via
max_accelerated_files - perhaps wasted-memory pressure, if relevant
Besides conservative thresholds, I would like to see separate handling for:
- opcode memory full
- interned strings full
- script/key table exhaustion
My opinion on the actual UX; something like:
- “Opcode cache is enabled, but its memory appears saturated.”
- “Interned strings buffer is exhausted or nearly exhausted.”
- “Ask your host or server admin about increasing opcache.memory_consumption, opcache.interned_strings_buffer, or opcache.max_accelerated_files.”
#2
@
5 weeks ago
Or... if we want to double down on recommended values, we should also add them to the Requirements page.
#3
@
5 weeks ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
#4
follow-up:
↓ 5
@
5 weeks ago
Would adding a recommendation about the revalidate_freq make sense here?
Usually this is set to a very low value by default and increasing it helps with performance gains.
For example 0 checks on every request but increasing it to 10 checks for file changes every 10 seconds.
#5
in reply to:
↑ 4
@
5 weeks ago
Replying to ozgursar:
Would adding a recommendation about the
revalidate_freqmake sense here?
Usually this is set to a very low value by default and increasing it helps with performance gains.
For example
0checks on every request but increasing it to10checks for file changes every10 seconds.
I would hesitate to recommend that users increase that setting because that can cause issues when updating files. (Either getting stale code, or worse, a mixture of old and new code causing strange bugs.) That is really something for advanced users only who are comfortable debugging and troubleshooting things.
See also #60397.
@
5 weeks ago
Here's the prototype when only the interned strings buffer is saturated. These configuration settings are BOTH performance-critical and impossibly geeked-out.
This ticket was mentioned in PR #11546 on WordPress/wordpress-develop by @sukhendu2002.
9 days ago
#7
- Keywords has-patch added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/64854
## Use of AI Tools
Screenshot of sample Recommended Improvement