Summary: alternative RSocket library for high performance network applications on JVM

July 6, 2021
RSocket java

RSocket is low latency/high throughput L5 network protocol, intended for high-performance services communication. It is transport agnostic, and runs on top of any reliable byte stream transport.

Alternative RSocket for JVM. Motivation

Several problems were present in official RSocket/RSocket-java libraries:

Message flow control semantics of Reactive Streams

Protocol offers complete set of interactions modelled as flow controlled, composable streams of binary messages, with error and cancellation as first-class concepts.

interface RSocket {
  Publisher<Payload> requestResponse(Payload payload);
  Publisher<Payload> requestStream(Payload payload);
  Publisher<Payload> requestChannel(Publisher<Payload> payloads);
  Publisher<Void> fireAndForget(Payload payload);
}

Reactive Streams conformance makes It compatible with project-reactor, akka-streams, rxjava2, and helidon-commons-reactive.

This new library demonstrates throughput of millions of messages per second / per vCPU with every interaction - more details below.

RSocket-JVM

Shared protocol core with minimal dependencies (only netty-buffer) for use with vendor libraries on JVM.

RSocket-JVM was verified with RSocket-reactor (project-reactor) and RSocket-helidon (helidon-commons-reactive).

Notable features:

         message size,bytes    8(same payload)        8             128            512

request-response                     2.2m            1.7m           1.6m          1.3m
request-stream                       3.5m            3.2m           3.2m          3.2m
request-channel                      4.8m            3.2m           3.1m          2.4m

Table 1. Single vCPU RSocket throughput (project-reactor, non-tls, TCP EPOLL with linux 5.4.0, jdk11), millions of messages per second.

Alternative: RSocket-RPC for application services

RPC system based on protocol buffers that relies on code generation with protobuf C++ plugin. It is compatible with GRPC.

Notable features:

The result is substantially higher performance: millions of messages per second per core.

         message size,bytes          8             128            512

request-response                    1.35m          1.0m          0.52m
request-stream                      2.4m           2.0m          0.9m
request-channel                     2.3m           1.9m          0.78m

Table 2. Single vCPU RSocket-RPC throughput (project-reactor, non-tls, TCP EPOLL with linux 5.4.0, jdk11), millions of messages per second.

Load estimator

Optimal load estimation for RSocket-RPC services based on requests lease.

Transport agnostic

RSocket is transport agnostic, and runs on top of any reliable byte stream transport.

Source code/binaries

Not publicly available

Alternative RSocket-RPC: fast application services communication and transparent GRPC bridge

May 20, 2021
RSocket java grpc

RSocket-JVM: streamlining implementation for each vendor platform

April 22, 2021
RSocket java helidon

Serving one million streams. Part 2. Double performance over original RSocket library

January 20, 2021
RSocket java