Lightweight and low-latency Java network library?

11,100

Solution 1

You can also try Jocket. It shares some concepts with Java Chronicle but is directly targeted at replacing the standard Socket implementation.

RTT latency is below the microsecond for a ping-pong between processes.

Solution 2

I suggest you to try kryonet framework.

Solution 3

If you want to communicate on the same machine you can try something like Java Chronicle which can support over a million persisted messages per second with sub-microsecond round trip times.

If you want low latency between machines, you need to look very carefully at your hardware. For commodity hardware your round trip latency will be 100 micro-seconds per more. With specialist hardware you are looking closer to 20 micro-seconds.

Or you could communicate on the same box and get much lower latencies. ;)

Solution 4

If you need ultra-high performance and throughput, I recommend using raw sockets (check out Socket and ServerSocket - there may be an nio version too). This will free you from the overhead contained in HTTP and other protocols

Share:
11,100
user1128016
Author by

user1128016

Updated on July 14, 2022

Comments

  • user1128016
    user1128016 almost 2 years

    I'm working on a client-server pair where the multithreaded client performs thousands invocations of the server per second and the first priority is to achieve a minimal latency. Throughput should be high as well. Both client and server are written in Java, communication semantics is quite simple (put/get operations).

    What is the best Java network library/framework for these requirements? Servers like Tomacat/Jetty seems to be heavyweight. I'm thinking about MINA or Netty, but I'm not sure that these asynchronous libs will provide a stable low latency under heavy workload.