redis / ioredis

🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
MIT License
14.25k stars 1.19k forks source link

major performance degradation when using authentication in cluster mode #1401

Open shyimo opened 3 years ago

shyimo commented 3 years ago

ioredis version: 4.27.6 Redis version: 6.2.4 Node.js version: 14.16.1 OS: Alpine Linux v3.11

Setting username & password on the Redis.Cluster constructor causing major performance degradation - mostly on cpu.

CPU usage without authentication:

no_auth

CPU usage with authentication:

with_auth

The tcp keep alive on redis.conf is set to default (300 seconds).

When running MONITOR command on one of the Redis leader instances we saw a different between auth tests and non-auth tests. when running with authentication, it seems like for every command ioredis also send AUTH command before the original command. i think it could be related to the cpu overhead.

maybe there is there a way to make authentication just 1 time as long as the tcp connection is alive ?

shyimo commented 3 years ago

Hi @luin ! do you know if there is known issue regarding that ?