Centrifugo is an open-source real-time messaging server. Centrifugo can instantly deliver messages to application online users connected over supported transports (WebSocket, HTTP-streaming, SSE/EventSource, WebTransport, GRPC). Centrifugo is built around channel concept – clients subscribe to channels to receive publications – so it's a user-facing PUB/SUB server.
-
Centrifugo is language-agnostic and can be used to build chat apps, live comments, multiplayer games, real-time data visualizations, collaborative tools, etc., in combination with any backend and frontend. It is well suited for modern architectures and allows decoupling of business logic from the real-time transport layer.
+
Centrifugo is language-agnostic and can be used to build chat apps, live comments, multiplayer games, real-time data visualizations, collaborative tools, AI streaming responses, etc., in combination with any backend and frontend. It is well suited for modern architectures and allows decoupling of business logic from the real-time transport layer.
Centrifugo scales horizontally, allowing multiple Centrifugo nodes in a cluster to load balance client connections. A message published to any Centrifugo node in this setup will be delivered to online subscribers connected to other nodes. This is achieved through an integration with a set of high-performance PUB/SUB brokers capable of handling millions of concurrent channels.
Several official SDKs for browser and mobile development wrap the bidirectional client-to-server protocol, offering a straightforward API for real-time subscriptions multiplexed over a single connection. These SDKs handle reconnects, manage ping-pong, timeouts, and deal with other complexities of working with real-time connections. Additionally, Centrifugo supports a unidirectional approach for simple use cases with no SDK dependency.
Real-time?
By real-time, we refer to a soft real-time system. This means there are no strict latency timing constraints. Centrifugo does its best to minimize delivery delays, but due to factors like network latencies, garbage collection cycles, and so on, those can't be guaranteed.
Centrifugo PRO provides advanced options to tweak connection message write behaviour.
By default, Centrifugo tries to write messages to clients as fast as possible. Centrifugo also does best effort combining different protocol messages into one transport frame (to reduce system calls and thus reduce CPU usage) without sacrificing delivery latency.
But still in this model if you have a lot of messages sent to each individual connection, you may have a lot of write system calls. These system calls have an huge impact on the server CPU utilization. Sometimes you want to trade-off delivery latency in favour of lower CPU consumption by Centrifugo node. It's possible to do by telling Centrifugo to slow down message delivery and collect messages to larger batches before sending them towards individual client. To achieve that Centrifugo PRO exposes additional configuration options.
+
We have customer reports showing that enabling options described here reduced total CPU usage of Centrifugo cluster by half. This may be a significant cost reduction at scale.
tip
Note, this is only useful when you have lots of messages per client. This specific feature won't be helpful with a case when the message is broadcasted towards many different connections as the feature described here only batches message writing it terms of a single socket.
The client_write_delay is a duration option, it is a time Centrifugo will try to collect messages inside each connection message write loop before sending them towards the connection.
Innovative answers to complex real-time messaging challenges
USED IN PRODUCTS OF SUCCESSFUL COMPANIES
THOUSANDS OF REAL INSTALLATIONS
Seamless Integration
Centrifugo is a self-hosted service which handles connections over various transports and provides a simple publishing API. Centrifugo nicely integrates with any application — no changes in the existing app architecture required to introduce real-time updates.
Great Performance
Centrifugo is written in Go language and includes some smart optimizations. See the description of the test stand with one million WebSocket connections and 30 million delivered messages per minute on hardware comparable to a single modern server.
Feature-rich
Centrifugo provides flexible auth, various types of subscriptions, channel history, online presence, delta updates, the ability to proxy connection events to the backend, and much more. It comes with official SDK libraries for both web and mobile development.
Out-of-the-box Scalability
Scale connections over many Centrifugo nodes by using built-in integrations with efficient brokers: Redis (or Redis Cluster, or Redis-compatible storages like AWS Elasticache, DragonflyDB, Valkey, KeyDB, with client-side sharding support), and Nats.
Proven in Production
Started a decade ago, Centrifugo (and Centrifuge library for Go it's built on top of) is mature, battle-tested software that has been successfully used in production by many companies around the world: VK, Badoo, ManyChat, OpenWeb, Grafana, and others.
Centrifugo PRO
Centrifugo PRO offers great benefits for corporate and enterprise environments by providing unique features on top of the OSS version: analytics with ClickHouse, real-time tracing, performance optimizations, push notification API, SSO integrations for web UI, etc.
What is real-time messaging?
Real-time messaging is used to create interactive applications where events are delivered to online users with minimal delay.
Chats apps, live comments, multiplayer games, real-time data visualizations, collaborative tools, etc. can all be built on top of a real-time messaging system.
Centrifugo is a user facing PUB/SUB server that handles persistent connections over various real-time transports — WebSocket, HTTP-streaming, SSE (Server-Sent Events), WebTransport, GRPC.
“We use Centrifugo to power real time updates and chat. It's been incredibly easy to use and reliable.”
- Victor Pontis, Founder at Luma
Looking for a cool demo?
Here is the real-time telemetry streamed from the Assetto Corsa racing simulator to the Grafana dashboard with a help of our WebSocket technologies.
This demonstrates that you can stream 60Hz data towards client connections and thus provide instant visual feedback on the state of the system.
Straightforward with Centrifugo! Even though your backend does not support concurrency. See the tutorial where we build a beautiful messenger app and go beyond usually shown basics.
Centrifugo is a versatile real-time component – it can be used to build various types of real-time applications, not just messengers.
Centrifugal Labs offers a PRO version of Centrifugo that includes a set of unique features, additional APIs, and enhanced performance. Ever dreamed about a self-hosted real-time messaging system combined with a push notification system? Want to benefit from analytics of real-time connections and subscriptions? Centrifugo PRO makes this possible. And much more actually.
Innovative answers to complex real-time messaging challenges
USED IN PRODUCTS OF SUCCESSFUL COMPANIES
THOUSANDS OF REAL INSTALLATIONS
Seamless Integration
Centrifugo is a self-hosted service which handles connections over various transports and provides a simple publishing API. Centrifugo nicely integrates with any application — no changes in the existing app architecture required to introduce real-time updates.
Great Performance
Centrifugo is written in Go language and includes some smart optimizations. See the description of the test stand with one million WebSocket connections and 30 million delivered messages per minute on hardware comparable to a single modern server.
Feature-rich
Centrifugo provides flexible auth, various types of subscriptions, channel history, online presence, delta updates, the ability to proxy connection events to the backend, and much more. It comes with official SDK libraries for both web and mobile development.
Out-of-the-box Scalability
Scale connections over many Centrifugo nodes by using built-in integrations with efficient brokers: Redis (or Redis Cluster, or Redis-compatible storages like AWS Elasticache, DragonflyDB, Valkey, KeyDB, with client-side sharding support), and Nats.
Proven in Production
Started a decade ago, Centrifugo (and Centrifuge library for Go it's built on top of) is mature, battle-tested software that has been successfully used in production by many companies around the world: VK, Badoo, ManyChat, OpenWeb, Grafana, and others.
Centrifugo PRO
Centrifugo PRO offers great benefits for corporate and enterprise environments by providing unique features on top of the OSS version: analytics with ClickHouse, real-time tracing, performance optimizations, push notification API, SSO integrations for web UI, etc.
What is real-time messaging?
Real-time messaging is used to create interactive applications where events are delivered to online users with minimal delay.
Chats apps, live comments, multiplayer games, real-time data visualizations, collaborative tools, AI streaming responses, etc. can all be built on top of a real-time messaging system.
Centrifugo is a user facing PUB/SUB server that handles persistent connections over various real-time transports — WebSocket, HTTP-streaming, SSE (Server-Sent Events), WebTransport, GRPC.
“We use Centrifugo to power real time updates and chat. It's been incredibly easy to use and reliable.”
- Victor Pontis, Founder at Luma
Looking for a cool demo?
Here is the real-time telemetry streamed from the Assetto Corsa racing simulator to the Grafana dashboard with a help of our WebSocket technologies.
This demonstrates that you can stream 60Hz data towards client connections and thus provide instant visual feedback on the state of the system.
Straightforward with Centrifugo! Even though your backend does not support concurrency. See the tutorial where we build a beautiful messenger app and go beyond usually shown basics.
Centrifugo is a versatile real-time component – it can be used to build various types of real-time applications, not just messengers.
Centrifugal Labs offers a PRO version of Centrifugo that includes a set of unique features, additional APIs, and enhanced performance. Ever dreamed about a self-hosted real-time messaging system combined with a push notification system? Want to benefit from analytics of real-time connections and subscriptions? Centrifugo PRO makes this possible. And much more actually.