Relay vs Laravel Reverb: A Real Performance Benchmark
We built Relay because we believed a WebSocket server written in Go would handle real-world connection loads more efficiently than one running in PHP. We wanted to find out by how much. So we ran a real benchmark. Here's exactly what we did, what we found, and what it means.
Test Setup
- Benchmark runner: Hetzner CAX11 (4GB RAM, ARM64, Ubuntu 24.04)
- Relay server: Hetzner CX23 (2 vCPU, 4GB RAM, Ubuntu 24.04) — separate machine, tested over network
- Reverb server: Running locally on the benchmark box (loopback — an advantage for Reverb)
- Load testing tool: k6 v0.55.0
- Test: Ramp from 0 to 1,000 concurrent WebSocket connections over 5 minutes, hold at 1,000 for 60 seconds
- Behavior: Each virtual user connects, subscribes to a public channel, and holds the connection open
- Configuration: Both servers used default configuration with no tuning
Results
What the Numbers Mean
Both servers handled 1,000 connections. That's the baseline. But look at what it cost each of them to get there.
Reverb hit 95% CPU. On the same hardware that Relay used at 18%. That means Reverb is near its ceiling at 1,000 connections on a $5 server. Relay is barely warming up. The headroom difference is what matters in production — when traffic spikes, Relay absorbs it. Reverb starts dropping connections.
The memory story is similar. Reverb consumed 63MB for the WebSocket process alone, plus the rest of the server pushed total RAM to 962MB — 26% of the available 3.72GB. Relay's process used 38MB, and the total server footprint was 700MB including Nginx, MySQL, and the Laravel app all running on the same box.
Go's goroutine model is the reason. Each WebSocket connection in Relay is handled by a goroutine — lightweight, cheap to schedule, and independently managed. PHP's event loop in Reverb is fundamentally different. It works, but it pays a higher price per connection.
The Honest Caveat
We want to be clear about what this benchmark does and does not show. 1,000 connections is the lower end of where these differences become meaningful. At 5,000 or 10,000 connections, we expect the gap to widen significantly — Reverb would likely need a larger server or horizontal scaling. Relay would continue on the same $5 box.
We also want to be fair to Reverb. It is a well-built product, officially maintained by the Laravel team, and the right choice if you want first-party support and are running a pure Laravel stack. This benchmark is not a reason to dismiss it — it is data to help you make an informed decision.
When to Choose Each
Choose Reverb if:
- You are running a pure Laravel monolith
- You want official first-party Laravel support
- You are comfortable managing your own server
Choose Relay if:
- You want better resource efficiency at scale
- You want a standalone server with no PHP or Laravel runtime dependency
- You want a managed cloud option with an open source exit ramp to self-hosting
- You want a Channel Inspector built into your dashboard
- You want to self-host with the option to migrate to managed hosting without changing any application code
Relay Cloud is a managed WebSocket hosting platform built on the open source Relay server. Free tier available. No credit card required.