docs: adjusted for multiple brokers

This commit is contained in:
Ilan Steemers
2015-09-06 14:48:33 +02:00
parent 44473ca408
commit 5e5bf2cc8d
6 changed files with 171 additions and 22 deletions
+59 -10
View File
@@ -52,6 +52,14 @@ timeout
The number of seconds a worker is allowed to spend on a task before it's terminated. Defaults to ``None``, meaning it will never time out.
Set this to something that makes sense for your project. Can be overridden for individual tasks.
.. _retry:
retry
~~~~~
The number of seconds a broker will wait for a cluster to finish a task, before it's presented again.
Only works with brokers that support delivery receipts. Defaults to 60 seconds.
compress
~~~~~~~~
@@ -100,20 +108,25 @@ The default behavior for schedules that didn't run while a cluster was down, is
You can override this behavior by setting ``catch_up`` to ``False``. This will make those schedules run only once when the cluster starts and normal scheduling resumes.
Defaults to ``True``.
.. _redis_configuration:
redis
~~~~~
Connection settings for Redis. Defaults::
redis: {
'host': 'localhost',
'port': 6379,
'db': 0,
'password': None,
'socket_timeout': None,
'charset': 'utf-8',
'errors': 'strict',
'unix_socket_path': None
# redis defaults
Q_CLUSTER = {
'redis': {
'host': 'localhost',
'port': 6379,
'db': 0,
'password': None,
'socket_timeout': None,
'charset': 'utf-8',
'errors': 'strict',
'unix_socket_path': None
}
}
For more information on these settings please refer to the `Redis-py <https://github.com/andymccurdy/redis-py>`__ documentation
@@ -131,7 +144,7 @@ of the cache connection you want to use::
'name': 'DJRedis',
'workers': 4,
'timeout': 90,
'django_redis: 'default'
'django_redis': 'default'
}
@@ -139,6 +152,42 @@ of the cache connection you want to use::
.. tip::
Django Q uses your ``SECRET_KEY`` to encrypt task packages and prevent task crossover. So make sure you have it set up in your Django settings.
.. _disque_configuration:
disque_nodes
~~~~~~~~~~~~
If you want to use Disque as your broker, set this to a list of available Disque nodes and each cluster will randomly try to connect to them::
# example disque connection
Q_CLUSTER = {
'name': 'DisqueBroker',
'workers': 4,
'timeout': 60,
'retry': 60,
'disque_nodes': ['127.0.0.1:7711', '127.0.0.1:7712']
}
Django Q is also compatible with the `Tynd <https://disque.tynd.co/>`__ addon on `Heroku <https://heroku.com>`__::
# example Tynd connection
import os
Q_CLUSTER = {
'name': 'TyndBroker',
'workers': 8,
'timeout': 30,
'retry': 60,
'disque_nodes': os.environ['TYND_DISQUE_NODES'].split(','),
'disque_auth': os.environ['TYND_DISQUE_AUTH']
}
disque_auth
~~~~~~~~~~~
Optional Disque password for servers that require authentication.
cpu_affinity
~~~~~~~~~~~~