Laravel Queue Worker and Horizon Setup Guide (2026)
Blocking user HTTP requests with heavy computations like invoice PDF generation, transactional emails, or external third-party API calls leads to poor UX. Laravel Queues combined with Laravel Horizon represent the modern, production-grade standard for processing asynchronous background jobs safely.
📌 Key Topics in This Guide
- • Laravel Queue Lifecycle & How It Works
- • Database vs. Redis Queue Driver Comparison
- • Critical artisan queue:work Parameters for Production
- • Setting up Laravel Horizon & Securing Dashboards
- • Supervisor Alternative: Persistent Processes on Skyversal
- • Resolving Memory Leaks, Timeouts & Stuck Jobs
How the Laravel Queue Architecture Works
When a user triggers an action like placing an e-commerce order, dispatching verification emails or webhook dispatches synchronously blocks the thread. Queues serialize the task and store it in an in-memory queue like Redis, returning an immediate 200 OK response to the user.
A long-running Queue Worker daemon continuously listens to queue channels, pulling and executing jobs independently in isolated memory threads.
Queue Driver Comparison: Database vs. Redis
| Metric | Database Driver | Redis Driver (Recommended) |
|---|---|---|
| Throughput & Latency | Moderate (Disk I/O & Row Locking) | Sub-millisecond (<1ms In-Memory) |
| Concurrent Worker Scaling | Bottlenecks after 10-50 workers | Easily handles 1,000+ workers |
| Laravel Horizon Support | ❌ Not Supported | ✅ Fully Supported & Required |
Production-Ready artisan queue:work Flags
php artisan queue:work redis --queue=high,default --tries=3 --timeout=90 --max-time=3600 --max-jobs=1000 --memory=128 --sleep=3
Configuring Laravel Horizon & Securing Access
Install Horizon via Composer and publish assets:
php artisan horizon:install
Running Daemon Workers on Skyversal PaaS (No Supervisor Needed)
Instead of manually configuring Linux Supervisor daemons and permissions on a VPS, simply define your worker command in your Skyversal PaaS dashboard under Processes. Skyversal automatically monitors, logs, and restarts workers on unexpected exits.