Tutorials Courses Interview Prep (100 Q&A) AI Tools (50) Developer Tools (50) Tracks Pricing Plans Blog & Articles Contact Us
Laravel Advanced & Architecture 5-8 Years (Senior) Hard Production Scenario

How do you debug and resolve Queue Worker starvation and RabbitMQ/Redis Queue backpressure in Laravel?

Real-World Scenario / Incident Description

A burst of 500,000 Welcome Email jobs blocked urgent Password Reset and Payment Verification jobs from processing for over 2 hours.

225 views • Updated 1 month ago

Solution: Strict Queue Prioritization & Dedicated Worker Pools

  1. Never dump all jobs into a single default queue.
  2. Partition queues by SLA: high, default, low, notifications:
    SendPasswordResetNotification::dispatch($user)->onQueue('high');
    SendMarketingNewsletter::dispatch($campaign)->onQueue('low');
    
  3. Configure Supervisor with weighted prioritization:
    # Dedicated High-Priority worker
    php artisan queue:work --queue=high,default,low --tries=3 --timeout=60
    
  4. Queue Rate Limiting:
    public function middleware(): array
    {
        return [(new WithoutOverlapping($this->userId))->releaseAfter(60)];
    }
    
Related Concepts: #Queue Tuning #Worker Starvation #Redis #Supervisor #Priority Queues