Skip to content

Horizon Queue Manager in rConfig V8 Core

Laravel Horizon is the queue manager behind rConfig V8 Core. After reading this page, you can understand how Horizon processes background jobs, monitor queues from the dashboard, configure Supervisor and environment variables, and troubleshoot common queue problems.

Most rConfig backend work runs through Laravel’s jobs and queues system, so operations execute in the background rather than blocking the web interface. Horizon runs as a persistent process managed by Supervisor and provides a web dashboard for real-time visibility into job throughput, execution status, and queue health.

Horizon manages the background execution of rConfig operations. The main responsibilities are:

  • Asynchronous job processing: runs time-consuming operations in the background so the web interface stays responsive and multiple tasks process concurrently.
  • Queue management: organises jobs into prioritised queues so critical operations (manual downloads, high-priority tasks) process before lower-priority work.
  • Worker supervision: monitors worker processes and restarts failed workers to keep processing capacity consistent.
  • Performance monitoring: reports job throughput, execution times, failure rates, and queue depths in real time.
  • Batch processing: groups related jobs into batches so a single job failure does not block an entire operation. A scheduled task is sent as a batch, then delivered to queues as individual per-device jobs.
  • Failed job handling: captures failed jobs with error details, stack traces, and retry actions.

Without Horizon running, none of these operations execute, which makes it critical to rConfig automation.

rConfig V8 Core uses several specialised queues, processed in First In First Out (FIFO) order. Higher-priority queues are serviced before lower-priority ones, so interactive user actions (such as a manual download) complete ahead of routine scheduled work.

Queue Priority Timeout Purpose
HighPriorityQueue 1 (highest) 4 hrs Critical jobs requiring immediate processing
ManualDownloadQueue 2 4 hrs Manual device configuration downloads triggered by users
TaskDownloadQueue 3 4 hrs Scheduled task configuration downloads
TaskSnippetQueue 4 4 hrs Snippet deployment jobs (Pro and above)
PolicyCompliance 5 4 hrs Policy compliance checks (Pro and above)
SnmpTrapQueue 6 4 hrs SNMP trap processing
PurgeDataJobs 7 4 hrs Data cleanup and purge operations
rConfigDefault 8 4 hrs General system jobs (backups, emails, maintenance)
default 9 (lowest) A few seconds Fallback queue, not actively used

From rConfig V6, all device download jobs are sent as batches. Before batches, a scheduled task ran as a single job, so one failure or delay affected the whole operation. With batches:

  • Each device becomes an individual job within the batch.
  • An individual job failure does not block the other jobs.
  • Per-device job status makes troubleshooting easier.
  • Execution is non-blocking and runs in parallel.
  • Horizon shows detailed batch status and progress.
  • Device backups: configuration downloads run as queued jobs in TaskDownloadQueue (scheduled) or ManualDownloadQueue (manual), so multiple devices back up concurrently.
  • Scheduled tasks: scheduled operations queue through the appropriate queue based on task type.
  • System maintenance: backup cleanup, log archival, and purge operations run in PurgeDataJobs and rConfigDefault.

Open the dashboard from External Tools → System Queue Manager, or browse directly to:

https://your-rconfig-domain.com/horizon

Access is restricted to users with the admin role.

A high-level overview of queue system health. Key metrics:

  • Jobs Per Minute: current processing rate across all queues. Higher means active work (backups or tasks running); lower means an idle period or a bottleneck.
  • Processes: number of active worker processes. This should match the worker count configured in Supervisor. A much lower number suggests crashed workers.
  • Jobs Past Hour: total job volume over the last 60 minutes, showing workload trends and peaks.
  • Failed Jobs: count of jobs that errored. Occasional failures are normal (device timeouts, connectivity); a high rate points to a systemic problem.
  • Job Status Distribution: a breakdown of pending, processing, completed, and failed jobs.
  • Horizon Status: whether Horizon is actively running and processing jobs.
  • Recent Jobs: the most recently processed jobs with execution time, status, and queue name.
Horizon dashboard showing jobs per minute, active processes, jobs past hour, and recent job statistics for rConfig V8 Core

Historical performance data for the queue system. Available metrics:

  • Jobs Processed: total job volume over the selected period, showing workload trends and peak usage.
  • Throughput: jobs processed per time unit, indicating processing capacity.
  • Runtime Analysis: execution time statistics that help identify slow operations.
  • Jobs Failed: failure trends, showing when issues started and whether they are increasing.
  • Jobs Per Minute: processing rate over time, useful for capacity planning.
  • Average Wait Time: how long jobs wait before processing. High values indicate insufficient worker capacity or a backlog.
  • Average Execution Time: how long jobs take to complete. Rising values may indicate performance degradation.
  • Time Range Options: view the past hour, 24 hours, 7 days, or a custom range.
Horizon metrics page showing throughput, runtime, wait time, and execution time charts over a selected time range

Monitor batch job processing. The view shows:

  • Batch ID and creation timestamp.
  • Total jobs in the batch.
  • Jobs completed, pending, and failed.
  • Overall batch progress percentage.
  • Individual job status within the batch.
  • Batch completion status.

Batches give non-blocking execution, granular troubleshooting (identify the specific failed device), real-time progress, and parallel processing. They cover all scheduled device downloads and manual multi-device downloads.

Horizon batches view listing batch jobs with completion percentage and per-job pending, completed, and failed counts

Jobs waiting to be picked up by a worker. The view shows the job type and class name, queue name and priority, wait time, and job payload.

A short-lived pending state during active processing is normal. Jobs that stay pending for extended periods point to worker capacity or processing problems.

A history of successfully executed jobs, showing the completion timestamp, execution duration, queue name, and payload. This history is cleared on a system restart or rConfig update.

A dedicated view for jobs that errored during execution. It shows the exception type and message, the full stack trace, the job payload, the failure timestamp, the queue name and connection, and the number of retry attempts.

Available actions: Retry a single job, Retry All failed jobs, Forget a job (remove it from the list without fixing the cause), and Forget All.

Different job types appear in Horizon, matching rConfig operations.

Job class Purpose Typical duration Common failures
App\Jobs\DeviceBackupJob Run a configuration download for a device 10 to 60 seconds Connection timeouts, authentication errors, prompt mismatches
App\Jobs\ScheduledTaskJob Run scheduled operations (backups, maintenance) Varies with scope Task configuration errors, device unavailability
App\Jobs\PurgeDataJob Clean old configs, logs, and temporary files Varies with data volume Disk space issues, database lock contention
  • Pending: queued but not yet picked up. Normal with a backlog; concerning if it persists, which points to worker issues.
  • Processing: a worker is executing the job. It should move to completed or failed within a reasonable time for that job type.
  • Completed: finished successfully. Review the execution time if it looks abnormally long.
  • Failed: errored during execution. Review the exception details for the cause.
  • Retrying: a failed job re-queued for another attempt. Watch whether the retry succeeds.

Supervisor manages the Horizon process, keeping it running and restarting it if it crashes. Without Supervisor running Horizon, all background jobs stop: scheduled tasks do not execute, backups do not run, and the queue fills with pending jobs.

Supervisor is a process control system for Linux and Unix that starts Horizon at boot, monitors its health, restarts it if it exits, logs startup and errors, and manages worker processes.

Configuration differs slightly between distributions but follows the same principles. From 8.2.19, setup_supervisor.sh writes the config for you, and update.sh rewrites it on every upgrade. It is a root-owned 0644 file rendered from the horizon_supervisor.ini stub in the app folder, with the web user and app folder filled in. Never symlink it from the app folder, and never set user=root. The program is named rconfig-core-horizon so it cannot clash with rConfig Pro’s horizon program on a shared server.

Configuration file location:

Terminal window
/etc/supervisord.d/rconfig-core-horizon.ini

Configuration file contents:

[program:rconfig-core-horizon]
process_name=%(program_name)s
command=/bin/sh -c 'exec php /var/www/html/rconfig/artisan horizon >> /var/www/html/rconfig/storage/logs/horizon.log 2>&1'
autostart=true
autorestart=true
user=apache
stdout_logfile=/dev/null
stdout_logfile_maxbytes=0
stderr_logfile=/dev/null
stderr_logfile_maxbytes=0
stopwaitsecs=3600

Key directives:

  • command: runs the Horizon artisan command through /bin/sh, which appends Horizon’s output to storage/logs/horizon.log. The shell opens the file after Supervisor has switched to the web user, so the log is owned by the web user. exec hands the shell’s process to PHP so Supervisor’s stop signal reaches Horizon.
  • autostart: start Horizon when Supervisor starts.
  • autorestart: restart Horizon if it exits.
  • user: the system user that runs the process. Always the web server user, never root.
  • stdout_logfile and stderr_logfile: /dev/null. supervisord runs as root, so it opens no log file of its own and never writes into the app folder.
  • stopwaitsecs: grace period before the process is killed (3600 seconds, to allow long-running jobs to finish).

Manage Supervisor:

Terminal window
# Check Supervisor status
systemctl status supervisord
# Start Supervisor
systemctl start supervisord
# Enable Supervisor to start on boot
systemctl enable supervisord
# Restart Supervisor
systemctl restart supervisord

Manage Horizon through Supervisor:

Terminal window
# Check Horizon worker status
supervisorctl status rconfig-core-horizon
# Start Horizon worker
supervisorctl start rconfig-core-horizon
# Stop Horizon worker
supervisorctl stop rconfig-core-horizon
# Restart Horizon worker
supervisorctl restart rconfig-core-horizon
# Reload Supervisor configuration
supervisorctl reread
supervisorctl update

Supervisor logs:

Terminal window
/var/log/supervisor/supervisord.log

Horizon appends to storage/logs/horizon.log itself, so nothing else trims it. setup_supervisor.sh (and so update.sh) also writes /etc/logrotate.d/rconfig-core-horizon, a root-owned 0644 file:

Terminal window
/var/www/html/rconfig/storage/logs/horizon.log {
su apache apache
size 50M
rotate 10
compress
missingok
notifempty
copytruncate
}

The log rotates once it passes 50 MB, and the last 10 copies are kept compressed. copytruncate lets Horizon keep writing to its open file, and su runs the rotation as the web user (www-data on Ubuntu), which owns storage/logs.

If logrotate is not installed, setup_supervisor.sh prints a warning and carries on, and the log grows without limit. Install it (sudo dnf install logrotate or sudo apt install logrotate) and run sudo ./setup_supervisor.sh again.

Configuring Horizon with environment variables

Section titled “Configuring Horizon with environment variables”

Horizon’s behaviour is controlled by environment variables in the .env file at /var/www/html/rconfig/.env. These settings control worker processes, timeouts, and retry behaviour.

Terminal window
HORIZON_PROD_TIMEOUT=60
HORIZON_MIN_PROCESS=1
HORIZON_MAX_PROCESS=10
HORIZON_DEFAULT_MAX_PROCESS=5
REDIS_QUEUE_RETRY_AFTER=130
  • HORIZON_PROD_TIMEOUT: seconds a job may run before it is terminated as a timeout. Default 60. Increase for long-running jobs (large backups). Must be lower than REDIS_QUEUE_RETRY_AFTER.
  • HORIZON_MIN_PROCESS: minimum worker processes Horizon keeps running, applied to all queues. Default 1. Ensures baseline capacity is always available.
  • HORIZON_MAX_PROCESS: maximum worker processes, applied to HighPriorityQueue, ManualDownloadQueue, TaskDownloadQueue, and TaskSnippetQueue. Default 10. Scales workers up during high load.
  • HORIZON_DEFAULT_MAX_PROCESS: maximum worker processes for the default-priority queues PolicyCompliance, SnmpTrapQueue, PurgeDataJobs, and rConfigDefault. Default 5.
  • REDIS_QUEUE_RETRY_AFTER: seconds to wait before retrying a job. Default 130. Must be greater than HORIZON_PROD_TIMEOUT to prevent the same job being processed twice.

Edit the .env file:

Terminal window
nano /var/www/html/rconfig/.env

After saving, clear the application cache:

Terminal window
cd /var/www/html/rconfig
php artisan rconfig:clear-all

Then restart Horizon. Supervisor restarts it automatically:

Terminal window
php artisan rconfig:clear-horizon
  • Timeout and retry: if you raise HORIZON_PROD_TIMEOUT, raise REDIS_QUEUE_RETRY_AFTER above it (at least timeout plus 30 seconds) to avoid duplicate processing.
  • Database connections: when raising HORIZON_MAX_PROCESS, check the database server’s maximum allowed connections. Each worker can use a connection. Monitor with SHOW STATUS LIKE 'Threads_connected';.
  • Resource planning: more workers means more CPU, memory, and database connections. Balance worker count against available resources and watch performance as you scale.

The dashboard shows “Inactive”, or jobs queue but never process.

Diagnose:

  1. Check Horizon status:

    Terminal window
    php artisan horizon:status

    Expected: Horizon is running. If it reports inactive, Horizon is not running.

  2. Check the worker through Supervisor:

    Terminal window
    supervisorctl status rconfig-core-horizon

    Expected: rconfig-core-horizon RUNNING pid 12345, uptime 1:23:45. Before 8.2.19 the program was named horizon. A STOPPED, FATAL, or EXITED status means Supervisor is not running Horizon.

  3. Check Supervisor itself:

    Terminal window
    # CentOS / RHEL / Rocky / Alma
    systemctl status supervisord
    # Ubuntu / Debian
    systemctl status supervisor

Resolve:

Terminal window
# 1. Ensure Supervisor is running (CentOS / RHEL / Rocky / Alma)
systemctl start supervisord
systemctl enable supervisord
# Ubuntu / Debian
systemctl start supervisor
systemctl enable supervisor
# 2. Reload Supervisor configuration
supervisorctl reread
supervisorctl update
# 3. Start the Horizon worker
supervisorctl start rconfig-core-horizon
# 4. Verify Horizon is running
php artisan horizon:status

Then open External Tools → System Queue Manager and confirm the dashboard shows an active status with processing metrics.

Supervisor shows FATAL or EXITED for horizon.

Check the logs:

Terminal window
tail -n 50 /var/log/supervisor/supervisord.log
tail -n 50 /var/www/html/rconfig/storage/logs/horizon.log

Common causes:

  • Incorrect file paths in the config: verify the artisan and PHP paths.

    Terminal window
    ls -la /var/www/html/rconfig/artisan
    which php

    Correct the Supervisor config if needed, then supervisorctl reread && supervisorctl update && supervisorctl start rconfig-core-horizon. On 8.2.19 or later, sudo ./update.sh --no-pull rewrites the config from the stub instead.

  • Permission issues: storage and bootstrap/cache must be owned by the web server user (apache on RHEL-family systems, www-data on Ubuntu). On 8.2.19 or later, fix this with:

    Terminal window
    cd /var/www/html/rconfig
    sudo ./update.sh --no-pull

    It hands only those folders back to the web user and leaves stored device configurations locked down. Avoid a blanket chown -R or chmod -R over the whole app folder.

  • PHP memory limit too low: review the PHP settings reference to set optimal PHP values.

Jobs queue but never process, staying in “Pending” indefinitely.

Check whether workers are processing:

Terminal window
php artisan horizon:status

In the dashboard, check the Processes count. It should match the workers configured in Supervisor plus any extra workers up to the maximum.

Resolve:

  • Horizon running but no active workers: restart it.

    Terminal window
    php artisan rconfig:clear-horizon
    # Supervisor restarts it automatically. If it stays stopped:
    supervisorctl start rconfig-core-horizon
  • Workers active but jobs still pending: this is usually queue priority. Jobs in higher-priority queues run first, so lower-priority jobs wait while a high-priority queue is busy.

  • Consistent backlog: raise the worker count in .env, then clear and restart.

    Terminal window
    # In /var/www/html/rconfig/.env
    HORIZON_MAX_PROCESS=15
    HORIZON_DEFAULT_MAX_PROCESS=8
    Terminal window
    php artisan rconfig:clear-all
    php artisan rconfig:clear-horizon

A high failure rate, with many jobs in the Failed Jobs section.

Open Failed Jobs in the dashboard, click a recent failure, and review the exception message and stack trace to find common patterns.

Failure pattern Example exception Resolution
Device connectivity Connection timeout, SSH connection refused Verify reachability, credentials, and firewall rules before retrying
Authentication Authentication failed, invalid credentials Update the device credentials, then retry
Configuration Command not found, invalid regex pattern Fix the command configuration, then retry
Resource exhaustion Out of memory, maximum execution time exceeded Increase the PHP memory limit or reduce concurrent jobs

After resolving the root cause, retry the jobs with Retry All, or retry individually after fixing specific issues.

Why is Horizon consuming excessive resources?

Section titled “Why is Horizon consuming excessive resources?”

High CPU or memory use by the Horizon process, causing system slowdown.

Check usage:

Terminal window
ps aux | grep horizon
top -p $(pgrep -f horizon)

Common causes:

  • Too many concurrent workers: reduce the maximums in .env, then clear and restart.

    Terminal window
    # In /var/www/html/rconfig/.env
    HORIZON_MAX_PROCESS=5
    HORIZON_DEFAULT_MAX_PROCESS=3
    Terminal window
    php artisan rconfig:clear-all
    php artisan rconfig:clear-horizon
  • Large payloads or memory growth: restart Horizon to clear memory, and schedule a regular restart.

    Terminal window
    # Restart Horizon daily at 3 AM. Put this in its own root-owned 0644 file,
    # such as /etc/cron.d/rconfig-core-horizon-restart, so it runs as the web
    # user (www-data on Ubuntu), never as root. Do not edit /etc/cron.d/rconfig-core:
    # update.sh rewrites it.
    0 3 * * * apache cd /var/www/html/rconfig && php artisan rconfig:clear-horizon
  • Inefficient jobs: review execution times in Metrics. Jobs over 5 minutes may need a smaller scope (fewer devices per job) or leaner command sets.

Why is the Horizon dashboard inaccessible?

Section titled “Why is the Horizon dashboard inaccessible?”

A 404 or blank page at /horizon.

Clear the application cache:

Terminal window
cd /var/www/html/rconfig
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan cache:clear

Verify Horizon is published:

Terminal window
php artisan horizon:install

Confirm the web server is serving rConfig and the routes are reachable, then restart services:

Terminal window
systemctl restart nginx php-fpm # Nginx
systemctl restart httpd php-fpm # Apache
  • Review the dashboard daily for failed jobs, unusual processing times, or growing queue depths.
  • Track CPU, memory, and disk usage to confirm capacity for queue processing.
  • Configure external alerting (Nagios, Zabbix, and similar) to fire when Horizon becomes inactive, failed jobs exceed a threshold, queue depth grows continuously, or worker processes stop.
  • Review batch completion rates to spot systematic issues with specific device groups.
  • Restart Horizon after every rConfig update so it picks up new code.

    Terminal window
    php artisan rconfig:clear-horizon
  • After resolving issues, clear old failed jobs so the interface stays clean. Retry the ones that may now succeed and forget the rest.

  • Review Metrics weekly. Rising average execution times, increasing failure rates, and high wait times all signal problems developing.

  • Baseline normal job volume and execution times so you can tell when capacity needs to grow.
  • Scale workers as device count grows, balanced against system resources (database connections, PHP memory, CPU).
  • Stagger scheduled tasks across time to avoid queue spikes overwhelming workers.
  • For database connections, the worst case is roughly HORIZON_MAX_PROCESS multiplied by the number of active queues. Ensure the database max_connections covers this plus regular web traffic. The default MySQL value of 151 is often too low for larger deployments.

The values below are starting points. Adjust to actual resources and workload, and scale incrementally.

Terminal window
HORIZON_MIN_PROCESS=1
HORIZON_MAX_PROCESS=5
HORIZON_DEFAULT_MAX_PROCESS=3
PHP memory_limit=256M
MySQL max_connections=151 (default)
Terminal window
# Check Horizon status
php artisan horizon:status
# Terminate Horizon gracefully (Supervisor restarts it)
php artisan rconfig:clear-horizon
# Pause Horizon (stop processing new jobs)
php artisan horizon:pause
# Continue Horizon (resume processing)
php artisan horizon:continue
# Clear all caches after .env changes
php artisan rconfig:clear-all
# Supervisor: status, start, restart the worker
supervisorctl status rconfig-core-horizon
supervisorctl start rconfig-core-horizon
supervisorctl restart rconfig-core-horizon
# Tail the logs
tail -f /var/www/html/rconfig/storage/logs/horizon.log
tail -f /var/log/supervisor/supervisord.log
  1. HighPriorityQueue (critical jobs)
  2. ManualDownloadQueue (user-triggered downloads)
  3. TaskDownloadQueue (scheduled downloads)
  4. TaskSnippetQueue (snippet deployment, Pro and above)
  5. PolicyCompliance (compliance checks, Pro and above)
  6. SnmpTrapQueue (SNMP trap processing)
  7. PurgeDataJobs (data cleanup)
  8. rConfigDefault (general system jobs)
  9. default (fallback, rarely used)
Item CentOS / RHEL / Rocky / Alma Ubuntu / Debian
Config /etc/supervisord.d/rconfig-core-horizon.ini /etc/supervisor/conf.d/rconfig-core-horizon.conf
Logs /var/log/supervisor/supervisord.log /var/log/supervisor/supervisord.log
Service supervisord supervisor
Horizon log storage/logs/horizon.log storage/logs/horizon.log
Log rotation /etc/logrotate.d/rconfig-core-horizon /etc/logrotate.d/rconfig-core-horizon
Web server user apache www-data
Issue Quick fix
Horizon inactive supervisorctl start rconfig-core-horizon
Jobs stuck pending php artisan rconfig:clear-horizon
Failed jobs piling up Review the failure details, fix the root cause, then retry
High memory usage Reduce HORIZON_MAX_PROCESS in .env
Dashboard inaccessible php artisan config:clear && systemctl restart httpd (or apache2)
After .env changes php artisan rconfig:clear-all && php artisan rconfig:clear-horizon
Worker not starting Check Supervisor logs, then run sudo ./update.sh --no-pull