I’m using redis with docker, and i have currently this error :
[ioredis] Unhandled error event: ReplyError: ERR max number of clients reachedSomeone could help me ?
Thank you
I’m using redis with docker, and i have currently this error :
[ioredis] Unhandled error event: ReplyError: ERR max number of clients reachedSomeone could help me ?
Thank you
2
Answers
Redis will accept a maximum number of connections. This error is Redis stating it has reached that limit. You can adjust this value in your redis.conf file.
That said, I usually see this when folks are connecting to Redis in a loop or in some sort of event and then don’t close the connection when they are done. You can do this by calling
.quit
from ioredis.In your redis.conf file there is a configuration:
This means that a maximum of 10K clients can connect to Redis at once.
Generally, this limit is enough and the problem lies on the client side who are opening the connection, doing some operation but not closing the connection when the work is done.
Or if you have some kind of looping logic in your client and you are initializing the connection inside the loop, thus opening multiple connections.
One last thing to keep in mind is, setting
does not gurantee that 10K clients will be able to connect to Redis. If redis server is not able to configure the process file limit to 10K, the maxclients is set to current file limit minus 32