For my projects, I will feel very comfortable using collectiveidea / delayed_job in rails2 and 3. I do not know beanstalkd, but I will try soon :-). I followed the suggestions in the resque docs. I will report this.
Resque vs DelayedJob
How does Resque compare to DelayedJob, and why do you choose one of them?
- Resque supports multiple queues
- DelayedJob supports lower priorities
- Resque workers are memory leak / bloat resistant
- DelayedJob workers are extremely simple and easy to modify.
- Resque requires Redis
- DelayedJob requires ActiveRecord
- Resque can queue JSONable Ruby objects as arguments
- DelayedJob can put any Ruby object in turn as arguments
- Resque includes a Sinatra app to monitor what is happening.
- DelayedJob can be requested from your Rails application if you want to add an interface
If you are developing Rails, you already have a database and ActiveRecord. DelayedJob is very easy to set up and works great. GitHub has used it for many months to handle nearly 200 million jobs.
Choose Resque if:
- You need several queues
- You don't need / don't like numerical priorities
- You do not need to persist every Ruby object
- You have potentially huge lines
- You want to see what happens.
- You expect a lot of setbacks / chaos
- You can customize redis
- You do not have enough RAM.
Choose DelayedJob if:
- Do you like numerical priorities
- You do not complete a gigantic amount of tasks every day.
- Your turn remains small and agile.
- Not many glitches / chaos
- You want to easily throw everything in line
- You do not want to install Redis
Choose Beanstalkd if:
- Do you like numerical priorities
- You need a very fast line
- You do not want to waste RAM.
- You want to complete a large number of tasks
- Everything is fine with JSONable Ruby objects in the queue as arguments
- You need several queues
In no way is Resque "better" than DelayedJob, so make sure you choose the tool that works best for your application.
Good comparison of queue speed :
enqueue work ------------------------------------------------- delayed job | 200 jobs/sec 120 jobs/sec resque | 3800 jobs/sec 300 jobs/sec rabbitmq | 2500 jobs/sec 1300 jobs/sec beanstalk | 9000 jobs/sec 5200 jobs/sec
Have a nice day!
PS There is a RailsCast about resque , deferred assignment ( modified version ) and Beanstakld . Take a look!
PPS My favorite choice now is Sidekiq (very simple, fast and efficient for simple tasks), see this page for comparison.
andrea Jan 26 '11 at 10:22 2011-01-26 22:22
source share