Can you post your diagnostics?
Not sure if it’s related but i started receiving the same error when i enabled
define(‘WP_CACHE_KEY_SALT’, ‘www.site.com’);
define(‘WP_REDIS_SELECTIVE_FLUSH’, true);
Flushing works fine without these
If you don’t need selective flushing, I highly recommend not using it.
You’ll find them under Settings – Redis and then at the bottom of the server list.
Got it! I’ve removed the IP and some site-specific info like the SALT
Status: Connected
Client: PhpRedis (v5.0.2)
Drop-in: Valid
Ping: 1
Redis Extension: 5.0.2
Predis Client: 1.1.1
PHP Version: 7.2.21-1+0~20190807.25+debian10~1.gbp935ebf
Multisite: No
Global Prefix: “wp_”
Blog Prefix: “wp_”
WP_REDIS_HOST: “—-REMOVED—”
WP_REDIS_PORT: —-REMOVED—
WP_CACHE_KEY_SALT: “—-REMOVED—”
WP_REDIS_PASSWORD: “*************************************”
Global Groups: {
“0”: “blog-details”,
“1”: “blog-id-cache”,
“2”: “blog-lookup”,
“3”: “global-posts”,
“4”: “networks”,
“5”: “rss”,
“6”: “sites”,
“7”: “site-details”,
“8”: “site-lookup”,
“9”: “site-options”,
“10”: “site-transient”,
“11”: “users”,
“12”: “useremail”,
“13”: “userlogins”,
“14”: “usermeta”,
“15”: “user_meta”,
“16”: “userslugs”,
“33”: “blog_meta”
}
Ignored Groups: [
“counts”,
“plugins”
]
Unflushable Groups: []
Dropins:
– advanced-cache.php v by
– Redis Object Cache Drop-In v1.5.0 by Till Krüss
Plugins:
– Akismet Anti-Spam v4.1.3 by Automattic (Active)
– AMP v1.4.0 by AMP Project Contributors (Active)
– CDN Enabler v1.0.9 by KeyCDN (Active)
– Classic Editor v1.5 by WordPress Contributors (Active)
– Custom Post Type UI v1.7.1 by WebDevStudios (Active)
– Disable REST API v1.4.3 by Dave McHale (Active)
– Fastly v1.2.9 by (Active)
– Heartbeat Control by WP Rocket v2.0 by WP Rocket (Active)
– Hotfix v1.2 by Mark Jaquith (Inactive)
– Jetpack by WordPress.com v7.9 by Automattic (Active)
– MonsterInsights – Dimensions Addon v1.3.0 by MonsterInsights Team (Active)
– MonsterInsights – EU Compliance v1.1.0 by MonsterInsights Team (Inactive)
– MonsterInsights Pro v7.10.0 by MonsterInsights (Active)
– Post Type Switcher v3.2.0 by John James Jacoby (Active)
– Query Monitor v3.4.0 by John Blackbourn (Inactive)
– Redis Object Cache v1.5.0 by Till Krüss (Active)
– SEO Friendly Images v3.0.5 by Vladimir Prelovac (Active)
– SEO Smart Links Professional v1.8.8 by Vladimir Prelovac (Active)
– Term Management Tools v1.1.4 by scribu (Inactive)
– User Role Editor v4.52 by Vladimir Garagulya (Inactive)
– VaultPress v2.0.1 by Automattic (Active)
– WP-Optimize – Clean, Compress, Cache v3.0.13 by David Anderson, Ruhani Rabin, Team Updraft (Inactive)
– WP-PageNavi v2.93.1 by Lester ‘GaMerZ’ Chan (Inactive)
– WP Minify v1.2.0 by Thaya Kareeson (Active)
– WP Super Cache v1.7.0 by Automattic (Inactive)
That’s strange. Can you run “wp cache flush” via WP CLI and see if that works?
How large is your Redis instance?
I don’t have WP-CLI access (managed LAMP) but my Redis is 1GB big.
Even from the redis console, a 1GB cache clear can be a little long (~10-15 sec?) but it is near instant for 100MB.
Did you change how you handle timeouts in the new version?
Aha, this is really good to know.
Yes, the timeouts have changed. For now, I’d suggest setting WP_REDIS_TIMEOUT
and WP_REDIS_READ_TIMEOUT
to 0
for infinite.
https://github.com/tillkruss/redis-cache#connection-parameters
I thought so. I’ll try the above, looks like it should work.
Maybe there’s a way to make it async to avoid issues with load-balancers timing out etc. But for now, it should work.
I appreciate the fast replies Till.
Cheers,
Good, I’m glad it’s working.
FLUSHDB is actually an atomic/blocking command, Redis won’t do anything until the flush is finished.
There is a FLUSHDB ASYNC command, which is supported and extensively tested by the business edition.
I was having this issue on several sites out of many that are all configured in more-or-less the same way. Disabling WP_REDIS_SELECTIVE_FLUSH solved the problem, but I need that enabled.
However, I then tried changing the value of WP_CACHE_KEY_SALT for a couple of sites and the problem was fixed.