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