5 ms·
When i started my project, I used Resque but almost immediately switched to Sidekiq a few months later. I understand it's almost impossible to run into thread s
by AznHisoka 11y ago
When i started my project, I used Resque but almost immediately switched to Sidekiq a few months later. I understand it's almost impossible to run into thread safety issues with Resque, but if you're doing anything CPU intensive, Sidekiq really offers much higher performance. The maintainer also makes a living off Sidekiq, selling it to businesses and enterprises too so you can expect more frequent updates.
- otterley 11y ago> but if you're doing anything CPU intensive, Sidekiq really offers much higher performance The threading model (LWPs vs. forking) should have no impact whatsoever on how quickly a CPU-intensive task completes.
- andrewvc 11y agoUnless it's a short-lived CPU intensive task, in which case in matters a great deal.
- AznHisoka 11y agoIt matters how many of these tasks can be completed in a fixed amount of time. Creating 50 processes requires more resources than 1 process with 50 threads.
- sanderjd 11y agoYeah, Sidekiq is an obvious switch once you find yourself running 20 500MB Rails processes just because you want to be able to handle a few simple tasks concurrently. If you have a few big, long-running, CPU-intensive background jobs, then the benefits are less clear, but if you have lots of small, short running jobs where you're mostly interested in throughput, then Sidekiq makes a lot more sense.
- otterley 11y agoResque-pool (https://github.com/nevans/resque-pool https://github.com/nevans/resque-pool) -- which every Resque user should be using -- loads your process first, then forks the workers. Forking uses copy-on-write semantics, so as long as you're loading everything before forking, you're conserving a great deal of otherwise wasted memory on what would be shareable pages.