-
Notifications
You must be signed in to change notification settings - Fork 109
Description
KEYS is very expensive command, according to manual:
Warning: consider KEYS as a command that should only be used in production environments with extreme care. It may ruin performance when it is executed against large databases. This command is intended for debugging and special operations, such as changing your keyspace layout. Don't use KEYS in your regular application code. If you're looking for a way to find keys in a subset of your keyspace, consider using SCAN or sets.
I saw that there was an attempt to change KEYS to SCAN and performance dropped.
IMO redis storage should use some kind of list/set to keep track of used metrics.
In our deployment, keys command its responsible for 90%+ load of whole redis instance and we use redis storage ONLY for jobs (APCu for http requests).