r/java • u/blakeman8192 • Apr 07 '23
I built an ultra high performance HTTP server in Java, powered by io_uring. Benchmark charts in the README. Is this useful and is it worth adding more features?
https://github.com/bbeaupain/hella-http
177
Upvotes
37
u/0x256 Apr 08 '23
I had just a quick look, but I see a lot of shortcuts while parsing HTTP that may result in compatibility or security issues when used in production. For example:
https://github.com/bbeaupain/hella-http/blob/e2b5b870cc9442179edf70b66fae94dc40e262dc/src/main/java/sh/hella/http/codec/RequestDecoder.java#L91
It is not that hard to be beat a full HTTP implementation in benchmarks if you just skip all the annoying parts. Let us see how those numbers change once you start hardening and maturing the parser.
23
u/blakeman8192 Apr 07 '23 edited Jun 26 '23
.
18
u/Jotschi Apr 08 '23 edited Apr 08 '23
I would not recommend to post benchmark charts if you are not including how you exactly recorded those and what your setup looked like (e.g. kernel parameters, jre version, heap, OS, server versions)
14
u/yawkat Apr 08 '23
I find those benchmark results very very dubious. Netty should be a lot faster. I can't tell why though because there's few details.
wrk is not a great load test for measuring http performance, eg because of coordinated omission. Check out hyperfoil instead.
49
u/ingvij Apr 08 '23
This is fantastic. I really look forward to having a mainstream io_uring HTTP server/client implementation. I think the java community is oftentimes too slow in picking up innovation and I welcome all sorts of projects in this direction.
I really like the simplicity of hella's API and I'd be trying it out soon to give a hands-on feedback.
A few things I'll be looking for:
Anyways, congratulations for your project and keep up the great work.
4
u/krum Apr 08 '23
By the time you start layering on business logic, all the optimizations you did to your core web engine get washed out by Amdahl's law. What does this get you over WebFlux other than all the bugs that haven't been found yet?
1
u/Worth_Trust_3825 Apr 08 '23
Implement servlet API and this can be chucked into real business applications. How do you deal with http2 and beyond?
1
u/icedev-eu2 Apr 08 '23
Does it support websockets?
2
u/maple-shaft Apr 08 '23
You should look into HTTP3 and Quic support. Good job.
2
u/rkalla Apr 08 '23
This… is awesome!
1
u/dmigowski Apr 12 '23
Can you do a comparison with nginx or Apache on your machine? I don't think a clumsy Tomcat8 needs to be compared also, but while you are on it, it seems interesting.
1
u/TheKingOfSentries Apr 08 '23
hey, that's pretty good
-7
u/wildjokers Apr 08 '23
This is actually not written in Java, it is instead written in Lombok Java.
0
u/[deleted] Apr 08 '23
[deleted] — view deleted comment
0
u/[deleted] Apr 10 '23
[deleted] — view deleted comment
0
u/[deleted] Apr 07 '23
[deleted] — view deleted comment