Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hscan for Util#expire #229

Merged
merged 3 commits into from
Jun 17, 2017
Merged

Conversation

dmkc
Copy link
Contributor

@dmkc dmkc commented Jun 13, 2017

For large apps, hgetall can take forever which will block Redis and suspend any Sidekiq job execution. Use hscan instead.

A question: is it useful to report the removed_keys? The issue is that with a huge app collecting all the IDs this will end up cloning uniquekeys in RAM on the app server. One of our production apps has a multi-gigabyte uniquekeys hash and running expire will kill it. If this is useful, I could add something like Util#silently_expire with a matching Rake task.

@mhenrixon
Copy link
Owner

I'd love to be able to report the deleted keys, I will get this merged and maybe you could create a second PR for the silently_expire?

@mhenrixon mhenrixon merged commit b882b47 into mhenrixon:master Jun 17, 2017
@dmkc
Copy link
Contributor Author

dmkc commented Jun 19, 2017

👍 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants