Full-keyspace SCAN in group-flush blocks Redis
-
- Plugin: Redis Object Cache (free version)
- Redis: 6.2.22, maxmemory 4GB, maxmemory-policy allkeys-lru
- WordPress + WooCommerce (HPOS enabled), PHP 8.4
- Keyspace size at time of testing: ~800,000-900,000 keys total
- Client: PhpRedis 6.3.0
Our store with a large Redis keyspace (800k+ keys), group-based cache invalidation (via the Lua EVAL script that performs a cursor-based SCAN + DEL loop) blocks Redis for 1-1.5 seconds per call. This makes the entire site (and every other visitor) unresponsive for the duration of each EVAL. Operations that trigger many group invalidations in quick succession — most notably WooCommerce’s “Generate variations” bulk action — cause a sustained outage of 60-100+ seconds, during which the site is effectively down for all concurrent users.
Disabled the object-cache.php drop-in (falling back to WP’s non-persistent cache) and repeated the exact same “Generate variations” action on the same product: zero latency issues, instant response, no site slowdown for other visitors. Re-enabled the drop-in and here again the issue.
My question: is there a configuration option to use a more targeted invalidation strategy (e.g. maintaining a per-group key index) instead of a full SCAN on every group flush, in the free version?
Does the Pro version solve this issue?
Thank you in advance
You must be logged in to reply to this topic.