Faster performance
Centrifugo PRO has performance improvements for several server parts. These improvements can help to reduce tail end-to-end latencies in the application, increase server throughput and/or reduce CPU usage on server machines. Our open-source version has a decent performance by itself, with PRO improvements Cenrifugo steps even further.
Faster HTTP API
Centrifugo PRO has an optimized JSON serialization/deserialization for HTTP API.
The effect can be noticeable under load. The exact numbers heavily depend on usage scenario. According to our benchmarks you can expect 10-15% more requests/sec for small message publications over HTTP API, and up to several times throughput boost when you are frequently get lots of messages from a history, see a couple of examples below.
Faster GRPC API
Centrifugo PRO has an optimized Protobuf serialization/deserialization for GRPC API. The effect can be noticeable under load. The exact numbers heavily depend on usage scenario.
Faster HTTP proxy
Centrifugo PRO has an optimized JSON serialization/deserialization for HTTP proxy. The effect can be noticeable under load. The exact numbers heavily depend on usage scenario.
Faster GRPC proxy
Centrifugo PRO has an optimized Protobuf serialization/deserialization for GRPC API. The effect can be noticeable under load. The exact numbers heavily depend on usage scenario.
Faster JWT decoding
Centrifugo PRO has an optimized decoding of JWT claims.
Faster GRPC unidirectional stream
Centrifugo PRO has an optimized Protobuf deserialization for GRPC unidirectional stream. This only affects deserialization of initial connect command.
WebSocket compression optimizations
Centrifugo PRO provides an integer option websocket_compression_prepared_message_size
(in bytes, default 0
) which when set to a value > 0 tells Centrifugo to use a cache or prepared websocket messages when working with connections with WebSocket compression negotiated.
This can significantly improve CPU and memory Centrifufo resource usage when using WebSocket compression feature.
Check out blog post Performance optimizations of WebSocket compression in Go application which describes the possible effect of this optimization.
Examples
Let's look at quick live comparisons of Centrifugo OSS and Centrifugo PRO regarding HTTP API performance.
Publish HTTP API
In this video you can see a 13% speed up for publish operation. But for more complex API calls with larger payloads the difference can be much bigger. See next example that demonstrates this.
History HTTP API
In this video you can see an almost 2x overall speed up while asking 100 messages from Centrifugo history API.