ruby on rails 4 - Background jobs occur very frequently and eat memory -


i'd optimize notification system, here how works now:

every time change occurred on application, we're calling background job (sidekiq) in order compute values , notify users via email.

this approach worked while, got memory leak there lot of actions , had 30-50 workers per second need refactor this.

what is, instead of running worker immediately, store in array , perform bit later.

but i'm afraid cause problem, "delayed" problem.

i'm looking forward hear more approaches , solutions well.

thanks in advance

so found 1 interesting solution:

i'm storing values redis directly key - value, value dataset data i'd need later computation. i'm using simple cron job, occurs service responsible reading data redis , computing them. optimized sidekiq workers work when cron executed, works fine , faster before.

i'm still eager hear if there other approach/solution.

thanks


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -