• Resolved LHAS

    (@furao77)


    Hi, thanks for the plugin.

    After updating 2.7.0 → 2.8.0 on a busy production site, every request became ~1s slower. Under concurrent traffic this exhausted the PHP-FPM pool and the site returned 502/504 (NGINX: upstream timed out). Reverting to 2.7.0 fixed it immediately. The Redis server itself was healthy throughout.

    Key finding — the overhead scales with the number of keys in the site’s Redis DB. Using the same 2.8.0 drop-in, a single WP-CLI request (no concurrency, warm cache):

    2.8.0 drop-in, Redis DB with ~26 keys (idle site): ~0.42s
    2.8.0 drop-in, Redis DB with tens of thousands of keys: ~1.44s
    2.7.0 drop-in, same large DB: ~0.49s

    So 2.7.0 is flat regardless of key count, but 2.8.0 adds a per-request cost proportional to how many keys exist in the database — looks like a per-request key-space scan/enumeration. This is why a low-traffic staging copy (tiny cache) showed no issue while production (large cache) was hit hard.

    Environment

    • Plugin: 2.7.0 (good) vs 2.8.0 (slow)
    • WordPress 7.0, PHP 8.3.31 (PHP-FPM + NGINX)
    • PhpRedis 6.3.0, igbinary not loaded
    • Redis server 6.2.20, localhost, maxmemory-policy allkeys-lru, rejected_connections: 0, plenty of free memory
    • Custom WP_REDIS_PREFIX and a dedicated WP_REDIS_DATABASE; WP_REDIS_TIMEOUT/READ_TIMEOUT = 3

    Ruled out: wp redis status on 2.8.0 = Connected / Drop-in Valid / Errors: []; Redis server fast (ping instant, few clients, no rejected connections); no PHP fatals. Moving object-cache.php aside instantly restored ~0.4s bootstrap.

    Questions

    1. Did 2.8.0 add a per-request key-space scan/count (or change connection/serializer handling) that scales with DB key count?
    2. Is this known with PhpRedis built without igbinary?
    3. Happy to provide a profiler trace or test a patch on a copy that reproduces it.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    there are no changes in 2.7.0 > 2.8.0 that would cause what you describe

    you can review it yourself: https://github.com/rhubarbgroup/redis-cache/compare/2.7.0…2.8.0#diff-16c63e751657afbaf95d54461967fca3589b4c0cddc848b867a56db1bf6650b2

    can use an APM tool like New Relic to prove where that extra 1 second load time comes from.

    Thread Starter LHAS

    (@furao77)

    You were right — thanks for pushing back, and apologies for the misleading report.

    I re-tested properly, and 2.8.0 is not the cause.

    Steady state (single WP-CLI request, warm cache, same Redis server): 2.7.0 and 2.8.0 are identical at ~0.42s, and it does not scale with key count — I retested against a DB with ~380,000 keys and 2.8.0 was still ~0.42s. So my “scales with key count” claim was simply wrong.

    Under concurrency (origin-direct load test, PHP-FPM pool max_children=10), mean / max response times, with 0 errors or timeouts in every run:

    • 20 concurrent: 2.8.0 (Metrics on) 59 / 96 ms vs 2.7.0 74 / 131 ms
    • 50 concurrent: 2.8.0 151 / 171 ms vs 2.7.0 156 / 187 ms
    • 100 concurrent (10× the pool): 2.8.0 285 / 335 ms vs 2.7.0 306 / 383 ms

    So 2.8.0 is equal-to-slightly-faster than 2.7.0, and having Metrics enabled made no difference. It’s now running in production on 2.8.0 with no issues (bootstrap ~0.42s, no 504s).

    What actually caused the incident: I had updated via WP-CLI (wp plugin update redis-cache), which updates the plugin but does not sync the drop-in — leaving plugin 2.8.0 + drop-in 2.7.0, so I then ran wp redis update-dropin separately. That meant hand-swapping the live object-cache.php on a high-traffic site, and the 504 burst was a one-off transient around that swap — not 2.8.0’s per-request behavior. My “1.44s” figure was measured during that overload, so it was an artifact of the saturated server, not the plugin. When I later upgraded through the wp-admin UI (which updates the plugin and syncs the drop-in together, in one step), it was completely clean.

    So this was entirely on my end — a CLI two-step that performed the drop-in swap separately, under load — not a 2.8.0 regression. Apologies for the noise, and thanks for the plugin.

    Plugin Author Till Krüss

    (@tillkruess)

    Great work, glad it’s solved!

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.