- How do I install Laravel Horizon for Redis queue monitoring?
- Run `composer require laravel/horizon` and then `php artisan horizon:install` to set up the dashboard and configuration file. Ensure Redis is running and configured as your queue driver in `.env`. Horizon requires Laravel 10+ and PHP 8.1+.
- Can Horizon monitor non-Redis queue drivers like database or SQS?
- Horizon is optimized for Redis queues and provides the most features when using Redis. While it can technically monitor other drivers, key features like the dashboard and real-time metrics rely on Redis. For database queues, consider alternatives like Laravel’s built-in queue worker.
- What’s the best way to configure worker supervisors in Horizon?
- Edit `config/horizon.php` to define supervisors for each queue connection. Specify the number of workers, timeout, and memory limits. Horizon’s code-driven approach keeps configurations version-controlled and team-friendly, unlike manual dashboard tweaks.
- Does Horizon support Redis Cluster for high-throughput queues?
- Yes, Horizon supports Redis Cluster starting from version 5.46.0. Configure your `redis:cluster` connection in `.env` and Horizon will automatically adapt. This is ideal for scaling beyond a single Redis instance to handle high job volumes.
- How do I handle failed jobs and retries in Horizon?
- Horizon provides built-in retry logic with configurable backoff strategies in `config/horizon.php`. Failed jobs appear in the dashboard, and you can customize failure handling via job middleware or the `failed_jobs` table. For critical paths, consider integrating with monitoring tools like Slack or Prometheus.
- Is the Horizon dashboard secure for production environments?
- The dashboard is self-hosted and doesn’t require external services, but you should restrict access via middleware (e.g., `auth` or `horizon`). For private deployments, use Horizon’s local environment support or private tunnels like SSH. Avoid exposing it publicly without additional security layers.
- Can I disable the Horizon dashboard and use it purely for CLI monitoring?
- Yes, Horizon’s dashboard is optional. You can disable it entirely by removing the Vite assets or configuring Horizon to run in headless mode. Use `php artisan horizon` in CLI to monitor queues without the frontend, reducing overhead for non-web environments.
- What Laravel versions does Horizon officially support?
- Horizon is officially supported for Laravel 10, 11, and 13. Version 5.44.0+ explicitly supports Laravel 13, while earlier versions work with Laravel 9+. Always check the [release notes](https://github.com/laravel/horizon/releases) for version-specific details.
- How do I extend Horizon to monitor custom job classes or third-party packages?
- Extend Horizon’s `JobProcessor` or use middleware to instrument custom jobs. For third-party jobs, ensure they’re dispatched through Laravel’s queue system and appear in Horizon’s dashboard. You can also create custom metrics by tapping into Horizon’s events or Redis pub/sub.
- What are the performance implications of using Horizon in production?
- Horizon adds minimal overhead (~500KB JS for the dashboard), but the primary impact comes from Redis. For high-throughput systems, use Redis Cluster or shard queues by connection. Lazy-load the dashboard in non-critical paths and consider server-side rendering for key metrics to reduce latency.