Giter Club home page Giter Club logo

Comments (16)

mperham avatar mperham commented on June 14, 2024 3

@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.

shaicoleman avatar shaicoleman commented on June 14, 2024 2

+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.

wenderjean avatar wenderjean commented on June 14, 2024 2

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.

garethson avatar garethson commented on June 14, 2024 1

@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.

antulik avatar antulik commented on June 14, 2024

+1 constantly growing redis memory usage became an issue for us due to sidekiq-statistic

from sidekiq-statistic.

felixbuenemann avatar felixbuenemann commented on June 14, 2024

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.

eggie5 avatar eggie5 commented on June 14, 2024

+1 I just tracked down our out of control memory growth to this!

from sidekiq-statistic.

eggie5 avatar eggie5 commented on June 14, 2024

@mperham yeah I think that would save everybody a lot of trouble.

from sidekiq-statistic.

jacek213 avatar jacek213 commented on June 14, 2024

That's a major issue, anyone tried to fixed that? I have to stop using this lib until it's fixed.

from sidekiq-statistic.

garethson avatar garethson commented on June 14, 2024

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.

MrJoy avatar MrJoy commented on June 14, 2024

@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.

wenderjean avatar wenderjean commented on June 14, 2024

I'm closing this issue considering we already have a feature to get rid of pretty old info on Redis.

from sidekiq-statistic.

drn avatar drn commented on June 14, 2024

Hi @wenderjean — can you clarify which feature you're referring to?

from sidekiq-statistic.

MrJoy avatar MrJoy commented on June 14, 2024

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.

drn avatar drn commented on June 14, 2024

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.

drn avatar drn commented on June 14, 2024

Got it, thanks for clarifying! I was mainly asking out of curiosity — this is helpful. Cheers 👋

from sidekiq-statistic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.