plokhotnyuk / hella-http

Hella fast HTTP server library for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hella-http

hella-http is a hella fast HTTP library for Java that uses nio_uring for I/O. It has a very small codebase and is one of the most scalable HTTP servers available for Java today.

Feedback, suggestions, and contributions are most welcome!

Requirements

  • Linux >= 5.1
  • Java >= 8

For both of these, the higher the version the better - free performance!

Maven Usage

Hella will be published to Maven central once the API has stabilized.

Hello World Example

public static void main(String[] args) {
    byte[] body = "Hello, world!".getBytes(StandardCharsets.UTF_8);
    String bodyLength = body.length + "";

    Response response = Response.builder()
        .status(200)
        .header("Content-Type", "text/plain")
        .header("Content-Length", bodyLength)
        .body(body)
        .build();

    new HttpServer(request -> response)
        .start()
        .join();
}

Benchmarks

Hella scales exceptionally well with large amounts of clients. The following 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.

Requests per Second

Requests per second benchmark

X axis: number of clients

Y axis: requests per second

Latency (microseconds)

Requests per second benchmark

X axis: number of clients

Y axis: latency in microseconds

License

MIT. Have fun and make cool things!

About

Hella fast HTTP server library for Java

License:MIT License


Languages

Language:Java 99.5%Language:Dockerfile 0.5%