Laravel Reverb Broadcasting at Scale | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    Laravel Reverb at Scale: Broadcasting Architecture, Queue Pressure, and Channel Authorization        On this page       1. [  Why the Default Reverb Setup Breaks Under Load ](#why-the-default-reverb-setup-breaks-under-load)
2. [  Decoupling Broadcast Events from the Request Cycle ](#decoupling-broadcast-events-from-the-request-cycle)
3. [  Use a Dedicated Broadcast Queue ](#use-a-dedicated-broadcast-queue)
4. [  Channel Authorization Without the N+1 Trap ](#channel-authorization-without-the-n1-trap)
5. [  Cache Authorization Results ](#cache-authorization-results)
6. [  Horizontal Scaling with a Shared Redis Pub/Sub Backend ](#horizontal-scaling-with-a-shared-redis-pubsub-backend)
7. [  Monitoring What Actually Matters ](#monitoring-what-actually-matters)
8. [  Takeaways ](#takeaways)

  ![Laravel Reverb at Scale: Broadcasting Architecture, Queue Pressure, and Channel Authorization](https://cdn.msaied.com/271/5a8bf1e074fde8573c019a938896d953.png)

  #laravel   #reverb   #websockets   #broadcasting   #queues  

 Laravel Reverb at Scale: Broadcasting Architecture, Queue Pressure, and Channel Authorization 
===============================================================================================

     23 Jun 2026      4 min read    ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said  

       Table of contents

1. [  01   Why the Default Reverb Setup Breaks Under Load  ](#why-the-default-reverb-setup-breaks-under-load)
2. [  02   Decoupling Broadcast Events from the Request Cycle  ](#decoupling-broadcast-events-from-the-request-cycle)
3. [  03   Use a Dedicated Broadcast Queue  ](#use-a-dedicated-broadcast-queue)
4. [  04   Channel Authorization Without the N+1 Trap  ](#channel-authorization-without-the-n1-trap)
5. [  05   Cache Authorization Results  ](#cache-authorization-results)
6. [  06   Horizontal Scaling with a Shared Redis Pub/Sub Backend  ](#horizontal-scaling-with-a-shared-redis-pubsub-backend)
7. [  07   Monitoring What Actually Matters  ](#monitoring-what-actually-matters)
8. [  08   Takeaways  ](#takeaways)

 Why the Default Reverb Setup Breaks Under Load
----------------------------------------------

Laravel Reverb ships with sensible defaults that work perfectly for demos and small apps. The moment you push beyond a few hundred concurrent connections or start broadcasting from high-frequency jobs, you hit a predictable set of problems: queue workers become the bottleneck, channel authorization adds latency on every subscribe, and a single Reverb process becomes a single point of failure.

This article focuses on three concrete production concerns: relieving queue pressure from broadcast events, hardening channel authorization, and running Reverb horizontally.

---

Decoupling Broadcast Events from the Request Cycle
--------------------------------------------------

Every `ShouldBroadcast` event dispatched inside a request is serialized and pushed onto a queue. If your broadcast queue shares workers with your default queue, a spike in HTTP traffic can starve WebSocket delivery.

### Use a Dedicated Broadcast Queue

```php
// app/Events/OrderStatusUpdated.php
class OrderStatusUpdated implements ShouldBroadcastNow
{
    public function broadcastQueue(): string
    {
        return 'broadcasting';
    }
}

```

Then in `config/horizon.php`, give that queue its own supervisor pool:

```php
'broadcasting' => [
    'connection' => 'redis',
    'queue' => ['broadcasting'],
    'balance' => 'auto',
    'minProcesses' => 2,
    'maxProcesses' => 10,
    'tries' => 3,
],

```

Using `ShouldBroadcastNow` skips the queue entirely for ultra-low-latency events where the payload is cheap to compute. Reserve it for lightweight events only — anything that hits the database should stay queued.

---

Channel Authorization Without the N+1 Trap
------------------------------------------

Private and presence channels call your authorization callbacks on every subscribe. If those callbacks issue unguarded Eloquent queries, a reconnect storm (e.g., after a deploy) will hammer your database.

### Cache Authorization Results

```php
// routes/channels.php
Broadcast::channel('orders.{orderId}', function (User $user, int $orderId) {
    $cacheKey = "channel_auth:{$user->id}:{$orderId}";

    return Cache::remember($cacheKey, now()->addMinutes(5), function () use ($user, $orderId) {
        return $user->can('view', Order::findOrFail($orderId));
    });
});

```

Five minutes is usually safe for order-level permissions. For presence channels that carry user metadata, cache the payload too:

```php
Broadcast::channel('team.{teamId}', function (User $user, int $teamId) {
    $member = Cache::remember(
        "presence_auth:{$user->id}:{$teamId}",
        now()->addMinutes(2),
        fn () => $user->teams()->find($teamId)
    );

    return $member ? ['id' => $user->id, 'name' => $user->name] : false;
});

```

---

Horizontal Scaling with a Shared Redis Pub/Sub Backend
------------------------------------------------------

Reverb uses Redis pub/sub to fan out messages across multiple server instances. The key is ensuring every Reverb worker subscribes to the same Redis channel namespace.

```bash
# .env on each node
REVERB_SERVER_HOST=0.0.0.0
REVERB_SERVER_PORT=8080
REVERB_SCALING_ENABLED=true
REVERB_SCALING_REDIS_HOST=redis-cluster.internal

```

Behind a load balancer, sticky sessions (IP hash or cookie-based) are **not** required when scaling is enabled — Reverb's Redis backend propagates messages to whichever node holds the connection. Confirm this in `config/reverb.php`:

```php
'scaling' => [
    'driver' => 'redis',
    'redis' => [
        'connection' => 'reverb',
    ],
],

```

Define a dedicated Redis connection in `config/database.php` so Reverb's pub/sub traffic doesn't share a connection pool with your cache or session drivers.

---

Monitoring What Actually Matters
--------------------------------

Reverb exposes a `/apps/{appId}/connections` endpoint (protected by your app secret) that returns current connection counts. Scrape it with a cron and push to your metrics store, or hook into Reverb's `ConnectionEstablished` and `ConnectionClosed` events:

```php
Event::listen(\Laravel\Reverb\Events\ConnectionEstablished::class, function ($event) {
    Metrics::increment('reverb.connections.active');
});

```

Track queue depth on the `broadcasting` queue separately from connection count — a growing queue with stable connections means your event payload computation is the bottleneck, not Reverb itself.

---

Takeaways
---------

- Isolate broadcast events onto a dedicated Horizon queue pool to prevent starvation.
- Cache channel authorization callbacks; reconnect storms will expose any unguarded query.
- Enable `REVERB_SCALING_ENABLED` with a dedicated Redis connection for true horizontal scale.
- Use `ShouldBroadcastNow` only for lightweight, database-free events.
- Monitor queue depth and connection count independently — they point to different bottlenecks.

 Found this useful?

          [  ](https://twitter.com/intent/tweet?url=https%3A%2F%2Fmsaied.com%2Farticles%2Flaravel-reverb-at-scale-broadcasting-architecture-queue-pressure-and-channel-authorization&text=Laravel+Reverb+at+Scale%3A+Broadcasting+Architecture%2C+Queue+Pressure%2C+and+Channel+Authorization) [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fmsaied.com%2Farticles%2Flaravel-reverb-at-scale-broadcasting-architecture-queue-pressure-and-channel-authorization) 

 Frequently Asked Questions 
----------------------------

  3 questions  

     Q01  Do I need sticky sessions when running multiple Reverb nodes behind a load balancer?        No. When `REVERB_SCALING_ENABLED=true` is set and Reverb uses Redis pub/sub, messages are propagated to whichever node holds the client connection, so sticky sessions are unnecessary. 

      Q02  When should I use ShouldBroadcastNow instead of ShouldBroadcast?        Use ShouldBroadcastNow only for events whose payload requires no database queries and where sub-second delivery matters. Any event that touches the database should remain queued to avoid blocking the request cycle. 

      Q03  How long should I cache channel authorization results?        Two to five minutes is a reasonable default for most permission models. Shorter TTLs suit presence channels with frequently changing membership; longer TTLs suit stable resource-level permissions like order ownership. 

  Continue reading

 More Articles 
---------------

 [ View all    ](https://msaied.com/articles) 

 [ ![Typed Enums as First-Class Domain Citizens in Laravel with PHP 8.3](https://cdn.msaied.com/282/71a8fc3e4cf4239b1bf6d38d57e0b985.png) laravel php8.3 enums 

### Typed Enums as First-Class Domain Citizens in Laravel with PHP 8.3

Go beyond simple enum labels. Learn how to attach behaviour, implement interfaces, and use backed enums as Elo...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 24 Jun 2026     3 min read  

  Read    

 ](https://msaied.com/articles/typed-enums-as-first-class-domain-citizens-in-laravel-with-php-83) [ ![RAG in Laravel: pgvector, Embeddings, and Retrieval-Augmented Generation in Practice](https://cdn.msaied.com/281/8d2ac57c0e69d3ff9f1e68faf0e4d10c.png) laravel ai pgvector 

### RAG in Laravel: pgvector, Embeddings, and Retrieval-Augmented Generation in Practice

Build a production-ready RAG pipeline in Laravel using pgvector, OpenAI embeddings, and a clean retrieval laye...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 24 Jun 2026     4 min read  

  Read    

 ](https://msaied.com/articles/rag-in-laravel-pgvector-embeddings-and-retrieval-augmented-generation-in-practice) [ ![Ship AI with Laravel: Failover, Queues, and Middleware for AI Agents](https://cdn.msaied.com/283/f0a6d6a6f22d9131bacb96bae1bfc10b.png) Laravel AI Agents Queues 

### Ship AI with Laravel: Failover, Queues, and Middleware for AI Agents

Learn how to make Laravel AI agents production-ready with automatic provider failover, background queue proces...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 24 Jun 2026     3 min read  

  Read    

 ](https://msaied.com/articles/ship-ai-with-laravel-failover-queues-and-middleware-for-ai-agents) 

   [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

Explore

- [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [Contact](https://msaied.com#contact-section)

Connect

- [   hello@msaied.com ](mailto:hello@msaied.com)
- [   +20 109 461 9204 ](tel:+201094619204)

© 2026 Mohamed Said. All rights reserved.

 [  ](https://github.com/EG-Mohamed) [  ](https://www.linkedin.com/in/msaiedm/) [  ](https://wa.me/201094619204) [  ](mailto:hello@msaied.com) [  ](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
