Comments (16)
@davydovanton I've put this gem on the "troublesome" list and removed it from the Related Projects wiki page since this bug hasn't been fixed.
from sidekiq-statistic.
+1, Redis killed by the Linux Out of Memory Killer.
As a workaround, I clear all the timeslist on a regular basis like this:
Sidekiq.redis do |conn|
conn.keys('*:timeslist').each { |key| conn.del(key) }
end
from sidekiq-statistic.
Sorry for the delay @drn.
I was actually referring to this piece of code: https://github.com/davydovanton/sidekiq-statistic/blob/master/lib/sidekiq/statistic/statistic/metrics/store.rb#L52
It was added in the past and since then we haven't seen activities here, that's the reason I closed the issue.
We should probably have other approaches to handle it and I really think we can discuss further, if that's the case we may want to create a new issue to change what we actually have.
from sidekiq-statistic.
@MrJoy This did seem to address the issue we were having, yes. It safely drops (very) old history once an upper bound is reached, so perhaps not the most elegant solution, but works for us while still rendering the tool very useful.
from sidekiq-statistic.
+1 constantly growing redis memory usage became an issue for us due to sidekiq-statistic
from sidekiq-statistic.
Maybe hyperloglog can be used to aggregate execution counts over longer periods. Redis' hyperloglog is exact for smaller counts and can be merged to aggregate data. So it would be possible to store counts per day/hour/whatever and then aggregate to bigger intervals. Eg. daily merge per hour to per day, per day to week and merge to total.
This only works for counting things and not for storing durations and all the possible keys have to be stores separately. But it's probably OK to have average execution time over a bounded period (eg. last month) and execution count per status unbounded using hll.
from sidekiq-statistic.
+1 I just tracked down our out of control memory growth to this!
from sidekiq-statistic.
@mperham yeah I think that would save everybody a lot of trouble.
from sidekiq-statistic.
That's a major issue, anyone tried to fixed that? I have to stop using this lib until it's fixed.
from sidekiq-statistic.
Lots more could be done to re-vamp how times are calculated and stored, but I think the solution I've got up at #107 could bring this gem back to stable and performant for those running a lot of jobs.
from sidekiq-statistic.
@garethson Does that mean this issue should be be closed, with a follow-up issue to improve storage efficiency? Or is there still a problem of unbounded memory growth after your patch?
from sidekiq-statistic.
I'm closing this issue considering we already have a feature to get rid of pretty old info on Redis.
from sidekiq-statistic.
Hi @wenderjean — can you clarify which feature you're referring to?
from sidekiq-statistic.
He's referring to expiration times. Redis can act as an LRU cache either globally, or explicitly per-value when an expiration is set.
from sidekiq-statistic.
Thanks for clarifying, @MrJoy
This may have changed recently, but my understanding is that there is no option to specify a global TTL in Redis and it must be specified per key. It looks like Redis 4.0 introduced some new functionality — https://redis.io/topics/lru-cache, but the eviction policies seem geared for using Redis as a cache rather than a queue.
Rather than having the users of this library adjust global Redis configuration or expiring keys generated by this library explicitly, it seems like it would make sense for the library to handle setting TTLs for these keys directly.
Feel free to leave this closed (my organization no longer uses the gem), but I do think that this library could benefit from handling expirations more explicitly either by default or through configuration.
Cheers 👋
from sidekiq-statistic.
Got it, thanks for clarifying! I was mainly asking out of curiosity — this is helpful. Cheers 👋
from sidekiq-statistic.
Related Issues (20)
- Improve translations for start/stop real time button HOT 1
- Improve hide feature on real-time tab HOT 2
- Add new workers to the table on real-time tab HOT 1
- Test support with Sidekiq 6 HOT 5
- Color of visited anchors is hard to read on dark mode HOT 2
- Undefined filename for Nil class error HOT 2
- Graph not displayed properly because of too many jobs HOT 2
- Version 1.5.0 still tagged as 1.4.0 in lib/sidekiq/statistic/version.rb ? HOT 1
- Release on rubygems? HOT 8
- Add support to i18n in Datepicker inputs
- Provide stats per host
- Empty workers HOT 2
- Version bump for 2.0.0 release? HOT 1
- Uncaught ReferenceError: jQuery is not defined
- Redis `redis.pipeline` is being deprecated HOT 4
- Remove JQuery dependency completely
- Warning from Redis HOT 3
- Verify Sidekiq's changes in version 6.5.0
- Problem with Sidekiq 7 HOT 1
- Issue with Sidekiq 7 and 2.0 release HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sidekiq-statistic.