Laravel Reverb Broadcasting at Scale | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://www.msaied.com/public) - [Home](https://www.msaied.com/public)
- [Projects](https://www.msaied.com/public/projects)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [About](https://www.msaied.com/public#about)

           [  Contact](https://www.msaied.com/public#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://www.msaied.com/public)
- [ProjectsCase studies](https://www.msaied.com/public/projects)
- [ArticlesEngineering notes](https://www.msaied.com/public/articles)
- [CertificatesCredentials](https://www.msaied.com/public/certificates)
- [AboutHow I work](https://www.msaied.com/public#about)
- [ContactGet in touch](https://www.msaied.com/public#contact)

  [Start a conversation](https://www.msaied.com/public#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://www.msaied.com/public)
2. /
3. [Articles](https://www.msaied.com/public/articles)
4. /
5. Laravel Reverb at Scale: Broadcasting Architecture, Queue Pressure, and Channel Authorization

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

 Move beyond the default Reverb setup and learn how to architect broadcasting for high-throughput production: channel authorization patterns, queue pressure relief, and horizontal scaling strategies.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://www.msaied.com/public#person) Published 23 Jun 2026 · Updated 23 Jun 2026 · 4 min read

ShareCopy linkCopied

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

  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)

 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.

- [laravel](https://www.msaied.com/public/articles?search=laravel)
- [reverb](https://www.msaied.com/public/articles?search=reverb)
- [websockets](https://www.msaied.com/public/articles?search=websockets)
- [broadcasting](https://www.msaied.com/public/articles?search=broadcasting)
- [queues](https://www.msaied.com/public/articles?search=queues)

 Frequently asked questions 
---------------------------

  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.

   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.

   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.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

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

[About](https://www.msaied.com/public#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articleMonitor and Control Schedules, Queues, and Errors in Laravel with Watchtower](https://www.msaied.com/public/articles/monitor-and-control-schedules-queues-and-errors-in-laravel-with-watchtower) [Next articleBlackfire &amp; Xdebug Profiling in Laravel: Finding Real Bottlenecks](https://www.msaied.com/public/articles/blackfire-xdebug-profiling-in-laravel-finding-real-bottlenecks-1)  

   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)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://www.msaied.com/public#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/740/cce86edc21eddcbdd2f2454fadaf9c70.png)  · 3 min read### The Pipeline Pattern in Laravel: Custom Pipelines Beyond Middleware

5 Oct 2026 ](https://www.msaied.com/public/articles/the-pipeline-pattern-in-laravel-custom-pipelines-beyond-middleware-1) [ ![](https://cdn.msaied.com/739/2d6897fdcdcf090613f96f72a64b8a78.png)  · 4 min read### MySQL Full-Text Search in Laravel: Indexes, Relevance Scoring, and Boolean Mode

4 Oct 2026 ](https://www.msaied.com/public/articles/mysql-full-text-search-in-laravel-indexes-relevance-scoring-and-boolean-mode) [ ![](https://cdn.msaied.com/738/073696a3fefe18bec825beec5ac658f5.png)  · 4 min read### Laravel Queue Rate-Limited Middleware: Throttling Jobs Without Losing Work

4 Oct 2026 ](https://www.msaied.com/public/articles/laravel-queue-rate-limited-middleware-throttling-jobs-without-losing-work) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://www.msaied.com/public#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://www.msaied.com/public)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://www.msaied.com/public/sitemap.xml)
