Configuring Job Queue

Pixelfed uses Redis to power the job queue that handles many important tasks. You can run the job queue with Horizon or a queue worker.

Using Horizon

Horizon provides a beautiful dashboard and code-driven configuration for our Redis queues. Horizon allows you to easily monitor key metrics of your queue system such as job throughput, runtime, and job failures.

While horizon does ship with Pixelfed, it is not enabled by default.

Installing Horizon

To install Horizon, run the following commands:

$ php artisan horizon:install

Supervisor Configuration

For more information, refer to the Laravel Documentation.

[program:horizon]
process_name=%(program_name)s
command=php /home/forge/app.com/artisan horizon
autostart=true
autorestart=true
user=forge
redirect_stderr=true
stdout_logfile=/home/forge/app.com/horizon.log
stopwaitsecs=3600

Using Queue Worker

Pixelfed includes a queue worker that will process new jobs as they are pushed onto the queue. You may run the worker using the queue:work Artisan command. Note that once the queue:work command has started, it will continue to run until it is manually stopped or you close your terminal:

$ php artisan queue:work

TIP

To keep the queue:work process running permanently in the background, you should use a process monitor such as Supervisor to ensure that the queue worker does not stop running.

Horizon vs Queue Worker

Pixelfed supports both Laravel Horizon and Queue Workers to power the job queue. The main difference between Horizon and Queue Worker is the dashboard provided by Horizon as well as advanced load balancing. We recommend using Horizon.