Memory leaks and high CPU usage
Reverb Version
1.5
Laravel Version
12.6
PHP Version
8.3.2
Description
The memory leak is real
Same problem with the CPU
It just keeps accumulating, it hits some limits and restarts
And the CPU and RAM load does not drop even if you disconnect from the channel or stop broadcasting events
Gave more load lately and the graphs went to the ceiling faster
Steps To Reproduce
Reverb is launched as a separate service
Just connect to it and start broadcasting different events to different channels every 5 sec
REVERB_SCALING_ENABLED: true (2 pods in k8s)
Hey @Doclassif - how many connections are you handling and how many messages are you sending? Do you also see the same issue if you are not using Reverb with scaling enabled?
We are seeing the same behavior with 3 nodes and scaling enabled.
We restart reverb every time it reaches 50% of the global cpu usage of the instance, hence about every 3 days. Each red bar on the chart below is a restart.
We also graph connections. Active connections peak at ~1k.
We have not tested reverb without scaling. However, on a different project we are using scaling and noticed that the cpu usage never goes higher than 5% even after months without restart.
PHP 8.2.28 Debian 11.11 Libuv 1.40 Reverb 1.5.0 Laravel 12.8.1
Systemd unit:
systemctl cat reverb.service
# /etc/systemd/system/reverb.service
#
# Ansible managed
#
[Unit]
Description=Laravel Reverb
[Service]
ExecStart=/usr/bin/php /srv/project/current/artisan reverb:start
Restart=always
User=envoyer
Group=www-data
LimitNOFILE=65536
TimeoutStopSec=10
[Install]
WantedBy=multi-user.target
Hey @Doclassif - how many connections are you handling and how many messages are you sending? Do you also see the same issue if you are not using Reverb with scaling enable
It is enough to have 5-10 connections and send messages to channels every 5 seconds. Locally without scaling everything seems to be ok
i used but is dosent have any problem about cpu or memory maybe it back too your server softwere
We are also affected by the memory-leak behaviour.
Environment
- Laravel 11.x
- Reverb 1.5.x (latest as of Aug 2025)
- PHP 8.3
- Azure App Service Linux
→ 4 Reverb instances behind Redis pub/sub (REVERB_SCALING_ENABLED=true)
→ Each instance: 4 vCPU / 16 GB RAM - Process launched via Supervisor:
php -dmemory_limit=5G artisan reverb:start - No Octane, no Telescope.
Load pattern
- ≈ 22 000 concurrent WebSocket connections total (~5 500 per instance).
- Each client sends a heartbeat every 10 minutes, plus additional bi-directional traffic on demand.
Observed problem
- RSS starts well below 1 GB but climbs steadily.
- After ≈ 40–48 h the process hits the 5 GB limit and crashes with
Allowed memory size of 5368709120 bytes exhausted ….
Pulse instrumentation
- Pulse enabled
sent_messagessampling: 0.001connectionssampling: 1
Runtime metrics
app(\Illuminate\Broadcasting\BroadcastManager::class)
->getPusher()
->get('/connections'); // → 22 812 active connections
$response = app(\Illuminate\Broadcasting\BroadcastManager::class)
->getPusher()
->get('/channels', ['info' => 'subscription_count']);
$count = is_object($response) && isset($response->channels)
? count((array) $response->channels)
: 0;
$count; // → 17 576 channels