AnyCable for Laravel: reliable WebSocket infrastructure

We built AnyCable for Rails seven years ago. Now it’s Laravel’s turn.
After watching Inertia.js bridge our ecosystems, we decided to return the favor. AnyCable for Laravel is here: powering large-scale applications like Doximity, and designed to enhance your existing stack with competitive realtime capabilities.
Expanding Laravel’s realtime capabilities
Laravel’s broadcasting ecosystem is strong. Reverb provides solid WebSocket foundations, Pusher offers managed simplicity, and Soketi proved to be production-ready and is still around. AnyCable adds another dimension: realtime features that you can rely on and infrastructure that will scale beautifully.
Try AnyCable for Laravel today. Keep reading for features and a live demo.
Open Source foundation
AnyCable is MIT-licensed with core features free forever. Advanced features are built for the cluster mode. There’s also a managed option for teams preferring hands-off operations (in development).
Go-powered performance
AnyCable’s Go runtime handles the connection-heavy lifting while your Laravel app focuses on business logic. This architectural split delivers exceptional efficiency: unlimited concurrent connections with minimal resource overhead.
Horizontal scaling works through Redis, NATS, or embedded clustering. The efficiency gains become significant as you scale: dramatically lower RAM and CPU usage per connection.
We tested AnyCable vs. Reverb in the context of this demo app running in production mode. You can find the source code and additional details in this report. Feel free to suggest corrections!
Now, let’s give us a quick overview of the numbers we observed.
Connection capacity under load
One of the biggest and at the same time underestimated problems related to scaling realtime infrastructure is connection avalanches. What would happen in case of thousands of WebSocket clients trying to connect to your server at the same time (e.g., when you decided that it’s a good idea to restart all the servers)? Things may go pretty bad pretty quickly.
That’s why one of our performance criteria for realtime servers is how good they’re at taming the thundering herd of connection clients. And here are the results comparing Reverb and Anycable:
Scenario | Laravel Reverb | AnyCable |
---|---|---|
1,000 simultaneous connections | ✅ 100% success | ✅ 100% success |
2,500 simultaneous connections | ⚠️ 79.27% success | ✅ 100% success |
3,000 simultaneous connections | 💥 Server crashes | ✅ 100% success |
15,000 simultaneous connections | 💥 Server crashes | ✅ 99.73% success |
Broadcast performance
Another capability we always want to measure is the broadcasting latency (or how long all the chat room members gonna wait for your amazing joke to appear in the conversation). Below you can find some numbers (~10k virtual users, ~100-150 broadcasts per second):
Metric | Laravel Reverb | AnyCable |
---|---|---|
Average broadcast latency | 221 ms | 185 ms |
95th percentile latency | 923 ms | 792 ms |
Peak memory usage | 95 MB | 80 MB |
What we can tell here? To be honest, we were genuinely surpised by the performance characteristics of Laravel Reverb. Very solid! Great work. Now let’s talk about non-performance-related features of AnyCable.
Best-in-class reliability features
Realtime applications face unique challenges when they need to provide best-in-class user experience. AnyCable brings reliable streams and resumable sessions: advanced features that ensure users never miss messages, despite the common network instability.
- At-least-once delivery guarantees message arrival. You can trust that your users will receive messages, comments and content updates without having to hit “refresh”.
- Automatic state restoration seamlessly reconnects users without re-authentication, which saves your server resources and ensures stability on redeployments.
- Fallback transports (Server-Sent Events, long-polling) provide universal compatibility across networks and devices.
See it in action: Larachat Demo
We built Larachat to show AnyCable’s reliability features in action, not just tell you about them.
It’s a minimal chat app that looks familiar: React frontend, Inertia.js bridge, Laravel backend, SQLite persistence. Nothing fancy. The magic happens when you start breaking things.
First, let’s see how a typical chat could become troublesome if communication channel is not reliable. Below you can see Larachat backed by Laravel Reverb (feel free to substitute with any Pusher-speaking server):
Not-so-reliable Larachat backed by Laravel Reverb
One of the user’s network connection became unstable and the conversation unhappy-ended. A very basic and, unfortunately, common situation in realtime applications.
Now, let’s see how the same conversation develops with AnyCable:
Reliable Larachat backed by AnyCable. Check out a public Larachat powered by AnyCable+.
Feel the difference? You probably think that it requires incorporating such reliablity into your code and may not worth it. Not with AnyCable!
In the Larachat application, the change from at-most-once to at-least-once quality of service is achieved by a couple of tiny configuration changes:
- First, you set your
BROADCAST_CONNECTION
toanycable
(backed by our anycable-laravel package). - Then, you configure Echo to use the @anycable/echo package:
import Echo from "laravel-echo";
import { EchoCable } from "@anycable/echo";
window.Echo = new Echo({
broadcaster: EchoCable,
cableOptions: {
url: url: import.meta.env.VITE_WEBSOCKET_URL || 'ws://localhost:8080/cable',
},
// other configuration options such as auth, etc
});
Zero changes to your application code! Because at AnyCable, we believe that performance, reliability, and all the infrastructure-level problems are not your pain. Focus on your product, not your tech stack.
And here is a public Larachat powered by AnyCable+.
Laravel broadcasting: feature comparison
Feature | Laravel Reverb | Pusher | AnyCable |
---|---|---|---|
Reliable message delivery | Best effort | Best effort | At-least-once guarantee |
Connection recovery | Manual reconnect | Manual reconnect | Automatic with state restoration |
Offline message queuing | ❌ | ❌ | ✅ |
Fallback transports | WebSockets only | WebSockets + polling | WebSockets + SSE + polling |
Message size limit | PHP memory limit (~8MB) | 10KB per message | Configurable (no hard limit) |
Custom authentication | Laravel guards | Webhooks | Laravel guards + JWT |
Built-in monitoring | Basic logs | Dashboard + metrics | Prometheus metrics |
Message history/replay | ❌ | Limited (24h) | ✅ Configurable retention |
License | MIT | Commercial | MIT |
Building bridges
Seven years ago, we intoduced AnyCable to bring competitive reliability to Rails realtime features. It succeeded. Now we’re extending those same capabilities to Laravel’s thriving ecosystem.
Consider this our contribution to the Laravel community that gave us Inertia.js. The early response has been encouraging: the first community PR was opened and merged within days, and the announcement resonated with developers exploring advanced realtime capabilities.
Cross-ecosystem collaboration makes everyone’s tools better.
Try AnyCable for Laravel. Break it. Tell us what’s missing. Your feedback shapes what we build next.