-
-
Notifications
You must be signed in to change notification settings - Fork 1
Throttle cache stats writes to avoid per-request option updates #82
Copy link
Copy link
Closed
Labels
area: cachePage cache, menu cache, preload, invalidation, observability, or cache settings.Page cache, menu cache, preload, invalidation, observability, or cache settings.area: performancePerformance-sensitive behavior, page weight, caching, preloading, or resource hints.Performance-sensitive behavior, page weight, caching, preloading, or resource hints.bugConfirmed or likely defect affecting runtime behavior, UX, compatibility, or data handling.Confirmed or likely defect affecting runtime behavior, UX, compatibility, or data handling.priority: highImportant for the next planned release or high user impact.Important for the next planned release or high user impact.risk: release-blockerShould be resolved or explicitly deferred before the target release ships.Should be resolved or explicitly deferred before the target release ships.status: in-progressWork has a branch, PR, or active release branch implementation path.Work has a branch, PR, or active release branch implementation path.
Milestone
Metadata
Metadata
Assignees
Labels
area: cachePage cache, menu cache, preload, invalidation, observability, or cache settings.Page cache, menu cache, preload, invalidation, observability, or cache settings.area: performancePerformance-sensitive behavior, page weight, caching, preloading, or resource hints.Performance-sensitive behavior, page weight, caching, preloading, or resource hints.bugConfirmed or likely defect affecting runtime behavior, UX, compatibility, or data handling.Confirmed or likely defect affecting runtime behavior, UX, compatibility, or data handling.priority: highImportant for the next planned release or high user impact.Important for the next planned release or high user impact.risk: release-blockerShould be resolved or explicitly deferred before the target release ships.Should be resolved or explicitly deferred before the target release ships.status: in-progressWork has a branch, PR, or active release branch implementation path.Work has a branch, PR, or active release branch implementation path.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Finding
StatsStore::flush()writes the fullperform_cache_statsoption whenever any stat changes, and page-cache hit/miss/bypass paths call stat increments during normal frontend traffic.Evidence
src/Modules/Cache/PageCache.phpincrements and flushes stats on cache hits/stale hits, misses, lock waits, bypasses, and slow uncached requests.src/Modules/Cache/StatsStore.phppersists those changes withupdate_option( 'perform_cache_stats', ... , false )inflush().Impact
A busy site can turn otherwise cheap cached page views into frequent database writes. That undermines the page-cache module's main performance goal and can become a release-blocking scalability regression on high-traffic installs.
Suggested fix
Batch or sample observability writes instead of updating the option on every request. Reasonable options include a transient-backed throttle, periodic cron flush, in-memory aggregation per request class, or only writing top-miss/slow maps when thresholds change.
Acceptance criteria
perform_cache_statson every request.