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
Redis memory growth #6205
Comments
Is this Redis used for Sidekiq only? All transient Sidekiq data set a TTL (e.g. batch data, rate limiters, unique locks, process heartbeats). Global data structures (e.g. queues, retry, scheduled, dead sets) do not set a TTL as they should always be present but they should always trend toward empty unless your system is actively pushing data into them. No one has identified an actual Sidekiq data leak in many years. The Using Redis wiki page has some links to useful tools but I haven't scanned the Redis community for any new, useful, maintained tools in years. If you find anything, please let me know so we can add it. |
Good afternoon - thank you for the response Based on the above information and additional investigation, I have other questions:
|
Well, for instance the heartbeat is expired here: > transaction.expire(work_key, 60) Sidekiq Pro 4.x held dead batch data for 180 days, the same as the default dead timeout. This was fixed in #4217 in v5.0.0. My guess is you upgraded in the near past. |
👍 Thanks for pointing out - I also found HISTOGRAM_TTL I also didn't upgrade any time recently (definitely not this year), so not sure why it shows 180 days for batch created #4127 I see the following code:
which uses Thanks |
Yep, that’s where the 180 days is coming from. You are welcome to lower that number but I would not recommend lowering it below 30 days. |
👍 I'm a bit new to the Sidekiq/redis ecosystem, so apologies for the more or less naive questions
Any information/links to documents about batch state transitions is greatly appreciated.
That might be my |
|
Q1: If the batch consists of N jobs and 1 job dies after exhausting the number of retries, new Thank you again for great information and support |
These are specific implementation details and subject to change (but unlikely) and my poor memory. The code is the ultimate source of truth, of course. |
ruby-2.7.6
rails 6.1.7.6
Sidekiq (6.5.12)
redis_version:4.0.9
Sidekiq-pro (5.5.5)
Good afternoon
I'm investigating a slow memory bloat/leak on the Redis server being used by Sidekiq. I'd appreciate any information/suggestions about the following:
old
ornever expire
as currently there are no timestamps I can examine for patternsSidekiq::Batch::LINGER = 0
will solve the issue. But I saw release notes that now it's set to 24 hours by default, which wouldn't explain the memory leakAny other ideas or suggestions are welcomed
The text was updated successfully, but these errors were encountered: