- Introduction
- Features
- Terminology
- Requirements
- Installation
- Getting started
- Configuration
- Adding new jobs
- Processing jobs
- Scheduled jobs
- What happens with failed jobs?
- Debugging jobs in a synchronous mode
Use the file docs/examples/disqontrol.yml.dist
as a starting point for your
configuration file. The example file is well documented and you can follow the
comments directly in there. It contains the following sections:
Example:
log_dir: /var/log
cache_dir: /tmp/
A path to the Disqontrol log file, relative to the configuration file, or absolute.
A path where Disqontrol can save its cache files, relative to the configuration file, or absolute.
Example:
disque:
- host: '127.0.0.1'
port: 7711
password: 'foo'
The IP address of a Disque node
The port of a Disque node
The password (optional)
This section sets the default values for all queues that don't set the values explicitly.
Example:
queue_defaults:
job_process_timeout: 600
job_lifetime: 172800
failure_strategy: retry
max_retries: 25
failure_queue: 'failed-jobs'
How long a job can be processed before it times out, in seconds.
How long a job can wait in the queue before getting automatically deleted, in seconds.
The maximum allowed value is 3932100 seconds, or about 45,5 days.
How failed jobs should be handled.
Possible values:
retry
: Retry the failed job with an exponential backoff, ie. the job will be returned to the queue with an ever longer delayretry_immediately
: Retry the failed job immediately, until the job runs out of allowed retries.
How many times a failed job should be retried before we give up and move it to a failure queue.
A queue where failed jobs are moved to when they run out of retries.
Define all existing queues, their parameters - if they differ from the queue defaults - and their workers.
Example:
queues:
'registration-email':
worker:
type: command
command: 'php console email:send'
'pic-resize':
worker:
type: inline_php_worker
name: 'pic_resize_worker'
'rss-update':
job_process_timeout: 600
job_lifetime: 60
failure_strategy: retry_immediately
max_retries: 1
failure_queue: 'failed-rss-updates'
worker:
type: isolated_php_worker
name: 'rss_update_worker'
The key of each entry under queues
is the name of the queue. It can contain
any parameter from the section queue_defaults
.
The start of the worker definition. Each queue must have a worker.
The type of the worker. Possible values:
command
: A CLI commandinline_php_worker
: A PHP worker called directly in the consumerisolated_php_worker
: A PHP worker called in an isolated process
These parameters are interchangeable and exist for better readability. They designate the "address" of a worker: for PHP workers it's the name under which they're registered, for command-line workers, it's the command that will be called in order to process the job.
This section sets all default parameters for consumers that don't provide their own parameters.
Example:
consumer_defaults:
min_processes: 1
max_processes: 5
autoscale: true
job_batch: 10
The minimum number of processes the consumer should spawn.
The minimum number of processes the consumer should spawn.
Allow Disqontrol to spawn more consumers if there are many jobs coming in and there's a demand for more.
The maximum number of jobs processed in one consumer in one batch. The consumer will ask Disque for a batch of as many jobs as specified here and if possible (for workers that allow asynchronous calls) calls all workers in the batch at once.
This section defines consumers and which queues they should consume. You can define one consumer for each queue, one consumer for multiple queues, or even leave this whole section empty, in which case Disqontrol will spawn just one consumer for all queues defined above.
Example:
consumers:
- queues:
- 'registration-email'
- 'profile-update'
min_processes: 2
max_processes: 10
job_batch: 5
- queues:
- 'pic-resize'
This is the only required parameter of a consumer. List all queues this consumer should listen to.
You can also override any parameter from the consumer_defaults
section. Be
mindful of the indentation. The parameters from the consumer_defaults
must be
on the same indentation level as the word queues
.
All queues that don't have their own consumer will be served by the default Disqontrol consumer.