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.

QueuePriorityTimeoutPurpose
HighPriorityQueue1 (highest)4 hrsCritical jobs requiring immediate processing
ManualDownloadQueue24 hrsManual device configuration downloads triggered by users
TaskDownloadQueue34 hrsScheduled task configuration downloads
TaskSnippetQueue44 hrsSnippet deployment jobs (Pro and above)
PolicyCompliance54 hrsPolicy compliance checks (Pro and above)
SnmpTrapQueue64 hrsSNMP trap processing
PurgeDataJobs74 hrsData cleanup and purge operations
rConfigDefault84 hrsGeneral system jobs (backups, emails, maintenance)
default9 (lowest)A few secondsFallback 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 classPurposeTypical durationCommon failures
App\Jobs\DeviceBackupJobRun a configuration download for a device10 to 60 secondsConnection timeouts, authentication errors, prompt mismatches
App\Jobs\ScheduledTaskJobRun scheduled operations (backups, maintenance)Varies with scopeTask configuration errors, device unavailability
App\Jobs\PurgeDataJobClean old configs, logs, and temporary filesVaries with data volumeDisk 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.

Configuration file location:

Terminal window
/etc/supervisord.d/horizon.ini

Configuration file contents:

[program:horizon]
; Horizon rConfig Configuration
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/rconfig/artisan horizon
autostart=true
autorestart=true
user=root
redirect_stderr=true
stdout_logfile=/var/www/html/rconfig/storage/logs/horizon.log
stopwaitsecs=3600

Key directives:

  • command: path to the Horizon artisan command.
  • autostart: start Horizon when Supervisor starts.
  • autorestart: restart Horizon if it exits.
  • user: the system user that runs the process.
  • stdout_logfile: where Horizon logs are written.
  • 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 horizon
# Start Horizon worker
supervisorctl start horizon:*
# Stop Horizon worker
supervisorctl stop horizon:*
# Restart Horizon worker
supervisorctl restart horizon:*
# Reload Supervisor configuration
supervisorctl reread
supervisorctl update

Supervisor logs:

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

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 horizon

    Expected: horizon RUNNING pid 12345, uptime 1:23:45. 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 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 horizon:*.

  • Permission issues: the rConfig directory must be owned by the web server user.

    Terminal window
    # CentOS / RHEL / Rocky / Alma
    chown -R nginx:nginx /var/www/html/rconfig/
    # Ubuntu / Debian
    chown -R www-data:www-data /var/www/html/rconfig/
  • 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
    supervisorctl start 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 patternExample exceptionResolution
Device connectivityConnection timeout, SSH connection refusedVerify reachability, credentials, and firewall rules before retrying
AuthenticationAuthentication failed, invalid credentialsUpdate the device credentials, then retry
ConfigurationCommand not found, invalid regex patternFix the command configuration, then retry
Resource exhaustionOut of memory, maximum execution time exceededIncrease 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 (crontab)
    0 3 * * * 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 horizon
supervisorctl start horizon:*
supervisorctl restart 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)
ItemCentOS / RHEL / Rocky / AlmaUbuntu / Debian
Config/etc/supervisord.d/horizon.ini/etc/supervisor/conf.d/horizon_supervisor.ini
Logs/var/log/supervisor/supervisord.log/var/log/supervisor/supervisord.log
Servicesupervisordsupervisor
Web server usernginxwww-data
IssueQuick fix
Horizon inactivesupervisorctl start horizon:*
Jobs stuck pendingphp artisan rconfig:clear-horizon
Failed jobs piling upReview the failure details, fix the root cause, then retry
High memory usageReduce HORIZON_MAX_PROCESS in .env
Dashboard inaccessiblephp artisan config:clear && systemctl restart nginx
After .env changesphp artisan rconfig:clear-all && php artisan rconfig:clear-horizon
Worker not startingCheck Supervisor logs, verify paths and permissions