Timeout errors when load increases
Hi,
We're using a NodeJS-based app using express for routing http requests. Before routing the requests we have a middleware to perform some validation using Redis, wherein we use ioredis.
When the load is moderate it works fine. But when there is an increase in load, ioredis started throwing timeout errors.
Error: Command timed out at Timeout._onTimeout (/proj/node_modules/ioredis/built/command.js:261:33) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) { [stack]: 'Error: Command timed out\n' + ' at Timeout._onTimeout (/proj/node_modules/ioredis/built/command.js:261:33)\n' + ' at listOnTimeout (internal/timers.js:554:17)\n' + ' at processTimers (internal/timers.js:497:7)', [message]: 'Command timed out' }
Initially, we had the command timeout set as 2 seconds. It started throwing the error frequently. Post that we now changed it to 5 seconds. It was better than before, but still, we face the timeout issue when the load increases.
We didn't find any redis slowlog too. We're using a Kubernetes setup within which we use redis sentinels ( 1 master 2 slaves ) to connect to from the app.
Any help on this query would be helpful
Source: redis/ioredis