tree: da8129cc9886873b37380d558eb3d3d8747cb71f [path history] [tgz]
  1. scripts/
  2. src/
  3. pom.xml
  4. README.md
ratis-experiments/README.md

Apache Ratis Experiments

This module has been created to house experimental projects. Details for running the experiment are mentioned below.

Building and Running The Experiments

Requirements

The flatbuffers compiler(flatc) is required for building this module. You can refer to this link for instructions on how to build from flatbuffers source.

Build Commands

The repository can be complied using mvn clean package -DskipTests -DbuildExp under the project root directory; see also BUILDING.md.

Zero-copy semantics - Flatbuffers

This program was developed to test the efficiency of flatbuffers vs protobuffers in terms of intermediate buffer copying. The Client creates a 1MB buffer, fills it with data and transfers it over GRPC.

Run Datatransfer Server and Client

There two pairs of Server and Client: (ClientProto, ServerProto) and (ClientFlat,ServerFlat).

run the client and servers by these commands from ratis-experiments directory:

for server: java -cp target/ratis-experiments-1.1.0-SNAPSHOT.jar org.apache.ratis.experiments.flatbuffers.server.ServerFlat

for client: java -cp target/ratis-experiments-1.1.0-SNAPSHOT.jar org.apache.ratis.experiments.flatbuffers.client.ClientFlat {numberOfReps}

replace noOfReps with the number of times you want to transfer data(defaults to 100,000).

Findings:

Current releases of flatbuffers with GRPC, do not provide zero-copy semantics in Java and have similar performance characteristics as compared to protobufs. Clarified in flatbuffers issue #6023.

Zero-copy semantics - Netty

The program was developed to test ability of Netty to avoid intermediate buffer copies created while serialization/deserialization. The Client creates a 1MB buffer, fills it with data and transfers it 10,000 times to a NettyServer instance over TCP.

Running Server and Client

The code for each(Client and Server) can be found in NettyZeroCopy submodule. Each of the necessary classes have been provided under encoders, decoders and objects.

Run the client and servers by these commands from ratis-experiments directory:

for server: java -cp target/ratis-experiments-1.1.0-SNAPSHOT.jar org.apache.ratis.experiments.nettyzerocopy.server.NettyServer

for client: java -cp target/ratis-experiments-1.1.0-SNAPSHOT.jar org.apache.ratis.experiments.nettyzerocopy.client.NettyClient

Findings:

Zero-copy semantics were achieved using Netty with significant performance improvements over GRPC.