Use queue:work with appropriate sleep configuration or Redis blocking pops to reduce database CPU polling overheads.
Queue workers set to poll databases without sleep configs execute continuous SELECT queries, driving database CPU usage up. Configure appropriate sleep intervals or use Redis queue drivers.
# Wait 3 seconds when queue is empty before polling again
php artisan queue:work --sleep=3 --tries=3 --timeout=90
- --sleep=3 pauses worker polling when no jobs are available
- Reduces CPU usage and database query loads on idle queue workers
- Redis queue driver uses blocking pop operations for instant zero-polling dispatch
Related Tips
View all tips →Monitor Aggregate Queue Metrics with Total Size Helpers in Laravel 13.27
Laravel 13.27 adds totalPendingSize(), totalDelayedSize(), and totalReservedSize() to the Queue facade, making it easy to aggregate queue metrics for dashboards and health checks.
Centralized Queue Routing with Queue::forward() in Laravel 13.26
Laravel 13.26 introduces Queue::forward() to reroute queued jobs to new queue names, different connections, or both without modifying job classes or dispatch sites.