Disable Redis on error?
-
[09-Feb-2024 07:41:09 UTC] RedisException: read error on connection to /var/run/redis/redis-server.sock in wp-content/object-cache.php:1918
[09-Feb-2024 07:41:09 UTC] RedisException: socket error on read socket in wp-content/object-cache.php:559
I configured the object cache to use phpredis with IGBINARY.
This is my setup:
define(‘WP_REDIS_CLIENT’,’phpredis’);
define(‘WP_REDIS_SCHEME’, ‘unix’);
define(‘WP_REDIS_PATH’, ‘/var/run/redis/redis-server.sock’);
define(‘WP_REDIS_MAXTTL’, 1200);
define(‘WP_REDIS_TIMEOUT’, 2);
define(‘WP_REDIS_READ_TIMEOUT’, 3);
define(‘WP_REDIS_RETRY_INTERVAL’, 50);
define(‘WP_REDIS_IGBINARY’, true);
It works very well, but very few requests (about twenty a day) fail me, and I don’t understand why. I tried debugging but I don’t notice any errors, maybe they are CPU load peaks…
Is it possible to manage that if the request to connect to redis for some request does not work instead of giving an error disable REDIS for that request?
- The topic ‘Disable Redis on error?’ is closed to new replies.