arturictus / sidekiq_alive

Liveness probe for Sidekiq in Kubernetes deployments
MIT License
194 stars 57 forks source link

Replace unsafe Redis 'keys' command to recursive 'scan match'. #52

Closed astrocket closed 3 years ago

astrocket commented 3 years ago

Using Redis 'keys' command in production is not proper and could cause i/o blocking while reading. Created simple PR replacing unsafe part.

https://redis.io/commands/keys

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.

Able1991 commented 3 years ago

An important change, we have 20kk tasks in sidekick, and the "keys" lays down redis

astrocket commented 3 years ago

@arturictus Can this be merged?

arturictus commented 3 years ago

Hi @astrocket , thanks for the PR. The release 2.1.1 has your PR :rocket: