Laravel Horizon Monitoring for Queues

Laravel
EmpowerCodes
Oct 28, 2025

Efficient queue management is a vital aspect of building scalable and high-performing Laravel applications. Whether you’re processing emails, background jobs, or time-consuming tasks like image uploads, queue systems ensure your app stays fast and responsive. But as your system scales, monitoring these queues becomes increasingly important — and that’s where Laravel Horizon comes in.

In this blog, we’ll explore Laravel Horizon, its benefits, setup, configuration, and how it simplifies the process of monitoring queues and managing workers in real-time.

Understanding Queues in Laravel

Before diving into Horizon, let’s understand what queues are and why they’re important in Laravel.

A queue allows you to defer the execution of time-consuming tasks to improve performance and user experience. Instead of running everything immediately during a user request, you can push these tasks to a queue and let Laravel process them in the background.

Common Use Cases for Queues

  • Sending emails and notifications

  • Generating invoices or reports

  • Processing file uploads or image resizing

  • Data synchronization between services

  • Running scheduled background jobs

Laravel provides multiple queue drivers like Redis, Beanstalkd, Amazon SQS, and Database, making it flexible and adaptable to various environments.

What is Laravel Horizon?

Laravel Horizon is a beautifully designed queue monitoring dashboard for applications running on the Redis queue driver. Developed by the Laravel team, Horizon provides deep insights into your queues, jobs, and workers — all through an intuitive web interface.

It helps developers manage and monitor job processing in real time, view failed jobs, retry them, and optimize worker performance without manual intervention.

Key Features of Laravel Horizon

  • Real-time dashboard: Monitor queues and jobs as they process.

  • Job metrics: View statistics like runtime, throughput, and job counts.

  • Failed job management: Easily retry or delete failed jobs.

  • Queue balancing: Automatically distribute jobs among workers.

  • Tag-based monitoring: Group jobs by tags for easier tracking.

  • Notifications: Receive alerts for failed jobs or performance issues.

Horizon simplifies queue management while providing complete visibility into your job system.

Installing Laravel Horizon

To get started with Horizon, ensure you have Laravel and Redis installed. Horizon works exclusively with the Redis queue driver.

You can install Horizon via Composer:

composer require laravel/horizon

Once installed, publish the Horizon configuration and assets:

php artisan horizon:install

Then, migrate the necessary tables for monitoring:

php artisan migrate

Finally, start Horizon:

php artisan horizon

When Horizon is running, it will start processing jobs and make the dashboard available at:

http://your-app-domain/horizon

This gives you a live view of all queued jobs and their statuses.

Configuring Laravel Horizon

Laravel Horizon’s configuration file, located at config/horizon.php, provides various options to define your workers, queues, and environments.

Worker Configuration

You can define multiple worker environments like local, staging, and production with different queue priorities and processes. For example, production may have more processes running compared to development.

Balancing Strategy

Horizon supports two balancing modes:

  • Simple: Jobs are distributed evenly among workers.

  • Auto: Horizon dynamically balances queues based on job load.

This ensures optimal performance without manual tuning.

Tags and Metrics

You can assign tags to jobs, making it easier to monitor specific tasks. Tags are useful for tracking job types such as email, invoice, or notification.

Horizon automatically records job metrics such as:

  • Total jobs processed

  • Average runtime per job

  • Failures over time

These metrics help developers identify bottlenecks and optimize processing speed.

Monitoring Queues in Real-Time

One of Horizon’s most powerful features is its real-time monitoring dashboard. From the dashboard, you can:

  • View active, pending, and completed jobs

  • Track processing speed and runtime metrics

  • Monitor worker activity and system health

  • Check queue load distribution

  • View retry and failed job logs

The dashboard updates automatically as jobs are processed, giving you a live look into how your background processes are performing.

Managing Failed Jobs

When jobs fail due to exceptions or timeout errors, Horizon captures them in the Failed Jobs section. You can:

  • View error messages and stack traces

  • Retry failed jobs directly from the dashboard

  • Delete or reprocess problematic jobs

This feature saves developers time during debugging and helps maintain reliability in production.

Horizon’s Job Metrics and Analytics

Horizon tracks and stores job performance data, giving you detailed analytics about your queue system. Metrics include:

  • Job throughput (jobs per minute/hour)

  • Runtime averages

  • Failures by job type

  • Processing trends over time

You can use these analytics to:

  • Detect performance bottlenecks

  • Identify frequently failing jobs

  • Optimize job priorities and worker counts

Laravel Horizon automatically stores this data in Redis, allowing you to view historical trends and performance graphs through the web interface.

Scaling with Laravel Horizon

When your application grows, queue workloads increase. Horizon makes scaling easy with its queue balancing and multiple worker configurations.

Scaling Strategies

  1. Increase the number of workers: Add more worker processes to handle higher job loads.

  2. Prioritize queues: Assign higher priority to critical queues like emails or notifications.

  3. Use multiple servers: Horizon can distribute workloads across servers with shared Redis connections.

Horizon Supervisors

Horizon uses supervisors to manage your queue workers. Each supervisor defines how many workers should run and which queues they should handle.

For example, a production supervisor might run 20 workers for high throughput, while local might use just 2.

Securing the Horizon Dashboard

Since the Horizon dashboard provides sensitive job and server information, access should be restricted to authorized users only.

Laravel Horizon uses the Horizon::auth method to define access control logic. Typically, only admin users or developers should have access.

You can restrict access by updating the HorizonServiceProvider like so:

Horizon::auth(function ($request) { return in_array($request->user()->email, ['admin@example.com']); });

This ensures only authenticated users with specific credentials can access the monitoring dashboard.

Using Horizon Notifications

Horizon can send notifications when job failures exceed a certain threshold or if queues are not running as expected.

You can configure these alerts in the config/horizon.php file under the notifications array. Laravel supports multiple notification channels such as email, Slack, or SMS, keeping your team updated about queue health.

Maintaining Horizon in Production

In production environments, Horizon should always be running to monitor and process jobs. Use Supervisor (Linux process manager) to ensure Horizon restarts automatically if it crashes.

Example Supervisor configuration:

[program:horizon] process_name=%(program_name)s command=php /path-to-your-project/artisan horizon autostart=true autorestart=true user=www-data redirect_stderr=true stdout_logfile=/path-to-your-project/storage/logs/horizon.log

This setup ensures Horizon runs continuously in the background, keeping your queues healthy and your jobs processing smoothly.

Benefits of Using Laravel Horizon

Laravel Horizon isn’t just a queue monitor — it’s a complete queue management solution. Here’s why developers love it:

  • Ease of use: Intuitive dashboard with live updates.

  • Powerful analytics: Insightful performance metrics.

  • Automatic balancing: Distributes jobs efficiently.

  • Custom notifications: Alerts for failures or downtime.

  • Developer productivity: Simplifies debugging and optimization.

Common Pitfalls to Avoid

While Horizon simplifies queue management, some mistakes can cause inefficiency or downtime:

  • Not running Supervisor in production — Horizon may stop unexpectedly.

  • Ignoring Redis memory limits — large workloads can cause Redis crashes.

  • Forgetting to set up alerts — missed failures can cause data loss.

  • Using blocking tasks — long-running jobs can delay other tasks.

Following best practices and regular monitoring ensures a stable queue system.

Conclusion

Laravel Horizon is one of the most powerful tools for monitoring and managing queues in Laravel applications. It provides a real-time dashboard, job analytics, failure management, and scaling capabilities — all with minimal configuration.

By integrating Horizon into your workflow, you gain complete visibility into your background processes, helping you maintain performance, reliability, and efficiency. Whether you’re managing a small application or a high-traffic enterprise platform, Horizon ensures your queues are always optimized, monitored, and running smoothly.