Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lightweight and low-latency Java network library? [closed]

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.

like image 680
user1128016 Avatar asked Jun 22 '12 14:06

user1128016


4 Answers

I suggest you to try kryonet framework.

like image 150
Sergii Zagriichuk Avatar answered Oct 23 '22 09:10

Sergii Zagriichuk


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. ;)

like image 38
Peter Lawrey Avatar answered Oct 23 '22 09:10

Peter Lawrey


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.

like image 2
pcdv Avatar answered Oct 23 '22 09:10

pcdv


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

like image 1
ControlAltDel Avatar answered Oct 23 '22 08:10

ControlAltDel