redis KEYS command blocking the whole server
Redis 7.2. We had a script doing KEYS session:* every minute to clean up old sessions. The keyspace has a few million keys. During each run the app sees latency spikes and Redis logs show it blocking. I know KEYS is O(N), but how bad is it really and what should I use instead? If you have hit this before, how did you handle it?
4 replies