Make WordPress Core

Opened 15 months ago

Last modified 15 months ago

#60053 new enhancement

Improve cache flush handling for large multisite database upgrades

Reported by: xparham's profile xParham Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Cache API Keywords:
Focuses: multisite, performance Cc:

Description

We run a large WP multisite (200 sub-sites) and with recent WP major version upgrades, the upgrade process has caused a significant performance drop while the database upgrade was in progress, causing downtime and 503 server errors. This seems to be mainly due to multiple back-to-back flushing of the object cache, network-wide, while the sites are under traffic.

In wp_upgrade() I see two calls to wp_cache_flush() which would happen for each of the subsite DB upgrades and I was wondering if things can be improved there.

  • Could we make the cache flush to be more selective and drop specific groups rather than dropping the whole network cache?
  • Could we do only one cache flush at the end of the DB upgrade for all sites instead of dropping the cache for each of the subsites' DB upgrades?
  • For object caching implementations that support subsite cache flushing (e.g. OCP) could we maybe utilize that feature?

I have attached some logs and reports from our APM. This was for upgrading from WP 6.3.x to 6.4.x, using Redis with Object Cache Pro, and 4GB of cached items.

Attachments (4)

OCP Logs 1.png (121.2 KB) - added by xParham 15 months ago.
OCP Logs 2.png (61.1 KB) - added by xParham 15 months ago.
APM.png (215.0 KB) - added by xParham 15 months ago.
Server Monitoring.png (441.4 KB) - added by xParham 15 months ago.

Download all attachments as: .zip

Change History (6)

@xParham
15 months ago

@xParham
15 months ago

@xParham
15 months ago

This ticket was mentioned in Slack in #core-performance by mukeshpanchal27. View the logs.


15 months ago

This ticket was mentioned in Slack in #hosting by joemcgill. View the logs.


15 months ago

Note: See TracTickets for help on using tickets.