Setup Redis with RQ for background task processing

If you want to scale Devilry to more than a couple of hundred users, you have to configure the RQ and Redis. RQ is installed by default, but you need to configure a task broker. We recommend Redis.

Install Redis


Configure Redis

Uncomment the requirepass setting in redis.conf to set a password. Remember to run Redis with this config, it is not loaded by default:

$ redis-server /path/to/redis.conf

You can tweak other configuration parameters in this file, such as port and other things, so check it out.

Add RQ setup for Redis Devilry

Add the following to ~/devilrydeploy/ (change secret to match the password in the redis.conf file) and set the correct config parameters for Redis to the RQ-queues:

#: Setup Redis connection settings for background task server.
from devilry.utils import rq_setup
RQ_QUEUES = rq_setup.make_simple_rq_queue_setting(

Run RQ workers

To run RQ workers, use:

$ cd ~/devilrydeploy/
$ venv/bin/python rqworker default email highpriority

Alternatively you can run one RQ worker for each queue:

$ cd ~/devilrydeploy/
$ venv/bin/python rqworker default
$ venv/bin/python rqworker email
$ venv/bin/python rqworker highpriority

Verifying the setup

You can verify the setup by running the devilry_test_rq_task management command:

$ cd ~/devilrydeploy/
$ venv/bin/python devilry_test_rq_task --queue default

Advanced setup

For full documentation for RQ_QUEUES setting, see . Just make sure you set up the config for these qeueues:

  • default

  • email

  • highpriority


Devilry updates may add more required queues. Be aware that custom tuning the RQ_QUEUES setting may break your setup when you update Devilry.