-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Prevent memory leaks (many locks stay in memory) #368
Comments
Now I have deleted all the
Is that normal? Can you consider settings an expiration (TTL) also on those keys? I think that setting a TTL for all keys is a good practice to protect against (expensive) memory leaks. BTW Thanks for the great work! |
I'll slap something together this weekend! Thanks for reporting |
I have the same issue. As a temporary workaround, I made the next in workers
i'm not sure will it help in my case or nor, but i'll keep an eye on digests array now. If somebody knows a better solution - please let me know. |
I think I know what was the problem in my case. If it's possible and "normal" scenario - then sorry for disturbing. |
Something is definitely wrong here:
Job enqueued:
Job is done:
But key still in Redis:
But digests is blank in Sidekiq UI and here:
Anyway job will not be enqueued any more:
Then if try to delete this digest from console:
It works again:
But not for long because key is there again. |
Thanks for the reports @ZhekaV and @collimarco I will get this fixed tonight! |
This is more a question than a real bug report. The problem is that we were investigating a high memory usage of Redis and we found that more than 90% of the keys (~15M) were:
And most keys were without a TTL. I can't say if the keys were leaked now or in an old version.
However I have a question... In order to avoid all these memory leaks in the future, is it enough to use the
lock_expiration
option?We use this:
Can you confirm that in this case the lock and its expiration are set in the same transaction (e.g. multi) so that we are guaranteed against memory leaks? If not, can you consider this as a feature request?
The text was updated successfully, but these errors were encountered: