Skip to main content

ERR max concurrent connections exceeded


New clients can not connect to the database throwing an exception similar to:

"message" : "[ioredis] Unhandled error event:
ReplyError: ERR max concurrent connections exceeded\r
at Object.onceWrapper (events.js:286:20)\r
at Socket.emit (events.js:203:15)\r at Socket.EventEmitter.emit (domain.js:448:20)\r
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:10)\n"


You have reached the concurrent connection limit.


You need to manage connections more efficiently. If you are using serverless functions, you can create the Redis client inside the function and close the connection when you are done with the database as below.


This solution may have a latency overhead (about 4 ms). See the blog post for more.

exports.handler = async (event) => {
const client = new Redis(process.env.REDIS_URL);
do stuff with redis
await client.quit();
do other stuff
return {
response: "response"


You can upgrade your database to Premium as it has higher limits. Or you can contact about the options with higher connectin limits.


See the blog post about the database connections in serverless functions.