Skip to content
Delayed Job vs Resque Shootout
Ruby JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app
config
db
doc
lib
log Barebones rails app May 30, 2012
public
script
test
vendor
.gitignore
.rvmrc
Gemfile
Gemfile.lock
README.rdoc
Rakefile
config.ru

README.rdoc

Background Benchmarks

I wanted to see the performance of Delayed Job w/ Postgres ActiveRecord backend vs Resque backed with Redis.

There are three branches in the project.

To test Delayed Job:

$ git checkout delayed-job
$ rake jobs:work
$ rails c
$ >> TestRunner.run(DJ, 10000)

To test Resque:

$ git checkout resque
$ QUEUE=* rake environment resque:work
$ rails c
$ >> TestRunner.run(RQ, 10000)

To test Resque with the Resque Jobs Per Fork plugin:

$ git checkout resque-jobs-per-fork
$ QUEUE=* JOBS_PER_FORK=5 rake environment resque:work
$ rails c
$ >> TestRunner.run(RQ, 10000)

Read Your Results

Look at your logs, and find the “Starting” entry There will be a corresponding “Stopping” entry at the end

Take the difference of the two timestamps, and divide 10000 / (stopping - starting)

And you will have the jobs/s rate of whatever backend you are using.

My Results

In my tests,

  • Delayed Job processed: 169 jobs/s

  • Resque processed: 113 jobs/s.

  • Resque w/ resque-jobs-per-fork plugin @ 5 jobs per fork: 290 jobs/s

  • Resque w/ resque-jobs-per-fork plugin @ 100 jobs per fork: 609 jobs/s

Todo:

  • Test multiple workers on each backend.

  • Test reading/writing to the database during the test

  • Test reading/writing to Redis during the test

  • Analyze memory usage

Something went wrong with that request. Please try again.