Open xblabs opened 2 weeks ago
Can you post your config, aside from host/port/password?
define('WP_REDIS_DATABASE', 2 );
define( 'WP_REDIS_USER_SESSION_DB ', 10 );
define( 'WP_REDIS_GLOBAL_GROUPS ', ['blog-details', 'blog-id-cache', 'blog-lookup', 'global-posts', 'networks', 'rss', 'sites', 'site-details', 'site-lookup', 'site-options', 'site-transient', 'users', 'useremail', 'userlogins', 'userslugs'] );
define( 'WP_REDIS_IGNORED_GROUPS', ['counts', 'plugins', 'user_meta', 'usermeta'] );
Updated in the description above as well
@tillkruss , do you think trimming the groups in a certain way could help?
@xblabs you may try to set WP_REDIS_FLUSH_TIMEOUT
to limit execution time of LUA script which using for flushing groups cache
@yatsukhnenko thanks! Do you spot any groups that could be more affected by ZRANGEBYSCORE and ZREMRANGEBYSCORE command use as those seem, so I can try to exclude them?
The Z*
commands are only used by the analytic feature, you can turn that off too if you like.
@tillkruss that seems to have been part of the problem. Checking Redis slow log the metrics key appears a lot. Disabling this via config seems to have alleviated the problem slightly,
I also reorganised the excluded groups and added all user related groups in there. Just to much individualzed cache data in conjunction with ACF. Note, we're talking about roughly 300K user rows plus several millions user meta rows.
@xblabs have you tried giving Redis more resources or using some kind of replication?
@tillkruss overall server resources had enough room, (at least I thought) even during times when the problem arose. That said, no, I haven't looked into replication (yet). I changed the Redsi conf now as well to force wider bg savve intervals.
Not sure if category "bug" is adequate, so excuse the choice.
Description
For the last month or so, I am stumbling over the problem that Wordpress suddenly throws an erro stemming from Redis Cache's access attempt of Redis.
I have restarted Redis multiple times but the problem "builds up" again during the course of a few days.
As per Redis slow log ( pasted below ) ZRANGEBYSCORE and ZREMRANGEBYSCORE Commands take a very long time (12-22 seconds). They are likely operating on a large sorted set.
Possible Fix
The only ideas I have now :
1) to check lua-time-limit to ensure this is set to a reasonable value (e.g., 1000 ms) to prevent long-running scripts from blocking the server.
2) Set an eviction policy if not already set to handle memory efficiently (maxmemory-policy).
3) implement a connection wrapper in the form ( crude first idea)
4) investigate how ZRANGEBYSCORE and ZREMRANGEBYSCORE Commands work in the context of the plugin
Steps to Reproduce
Sporadically occurring, usually when Redis' BG dump script is running
Environment
Additional context
Plugin Config
WP Error
Redis Stats
Plugin Context
Result of redis-cli slowlog get