Lightweight and low cost Java network library?

I work on a client-server pair, where a multithreaded client makes thousands of server calls per second, and the first priority is to achieve a minimum delay. Bandwidth should also be high. Both the client and server are written in Java, the semantics of communication are quite simple (put / get operations).

What is the best Java network library / framework for these requirements? Servers like Tomacat / Jetty seem heavy. I'm thinking of MINA or Netty, but I'm not sure if these asynchronous libraries will provide consistent low latency under heavy workloads.

+7
source share
4 answers

I suggest you try the kryonet framework.

+2
source

If you want to communicate on one computer, you can try something like the Java Chronicle, which can support more than a million constant messages per second with periods of microsecond shutdown for several microseconds.

If you need low latency between machines, you need to look very carefully at your equipment. For commercial equipment, your round-trip latency will be 100 microseconds. With special equipment, you look closer to 20 microseconds.

Or you can chat in one window and get significantly lower delays .;)

+2
source

You can also try Jocket . He shares some of the concepts with the Java Chronicle, but is directly aimed at replacing the standard Socket implementation.

RTT delay below microsecond for ping-pong between processes.

+2
source

If you need ultra-high performance and bandwidth, I recommend using raw sockets (check Socket and ServerSocket - there may also be a nio version). This frees you from the overhead contained in HTTP and other protocols.

+1
source

All Articles