I think io_uring is really cool, so I built JNI bindings in C to port it to the Java programming language. I called this project nio_uring in an ode to Java’s original high performance I/O libraries, nio.
Features of the nio_uring project include:
- A simple and flexible API
- Unparalleled scalability for network applications
- Zero-copy functionality
- Being slightly opinionated
This project enabled me to build hella-http, the fastest Java web-server this side of the Mississippi. Actually… I benchmarked it against all of the fastest Java HTTP libraries I could find, and hella-http beats all of them pretty handedly.
X: concurrent connections. Y: requests per second
X: concurrent connections. Y: latency in microseconds
The above benchmarks were conducted between two EC2 c5.2xlarge instances, which have 8 virtual CPUs and 16GB of RAM. The library used to conduct and measure the benchmarks was wrk
.
Kudos to the io_uring developers - this performance delta is more their accomplishment than mine. The io_uring syscall interface is particularly scalable because it was designed to be from the getgo, and it allows calling code to batch any number of I/O operations into a single syscall.
Version 0.1.2 is now available in the Maven central repository, which includes small bug fixes and performance improvements. The library is pretty well tested now, and I think I will work toward releasing a version 1.0.0 soon.
Until next time, have fun and build cool things!