is it possible to change the error message 'max number of client reached' to null or empty string?
I'm using redis as a cache for my DB values and in cases that I can't get the values from the cache I will get it from the DB. if I could configure it in the redis it self it would be the best option for me because my code won't have to change in order to support that edge case.
if someone has some tips on how to avoid such errors it would be nice as well :) (I'm using php scripts with predis package)
The error message
max number of clients reachedis clearly indicate that Redis is reached client limit and unable to serve any new requests.Predis\Clientin code. Instead to create a connection object once (singleton) and use it across process lifetime. The code probably create a new object on every request to Redis and keep all these connections open.phpprocesses are managed by a web server. The web server (e.g.apache prefork,nginx php-fpm) might leave processes for a long time both holding connections to Redis and exhaust server resources (mem, cpu).predislibrary.Bottom line: the code/web server exhaust
maxclientslimit.If you don't have control over code/web server (e.g.
nginx), to reduce amount of error messages you can:maxclientsover 10k (depends on your Redis server resources). This will reduce frequency of error messages.timeout(use it with cautious, as your code may assume that connections are never timeout). This will release old connections from a connection pool.tcp-keepalivefrom300seconds to less thantimeout. This will close connections todead peers(clients that cannot be reached even if they look connected).