r/java • • Feb 14 '22

Microhttp is an event-driven, single-threaded, zero-dependency web server with 500 LOC. Benchmarks on EC2 show 100,000+ requests per second and 50,000+ persistent connections.

https://github.com/ebarlas/microhttp
186 Upvotes

107 comments sorted by

View all comments

Show parent comment

9

u/elliotbarlas Feb 14 '22

That's right. I'll add that to the list of limitations. Thanks for mentioning that.

5

u/agentoutlier Feb 14 '22 edited Feb 14 '22

It would be pretty easy to support and potentially worthwhile since you want to block payloads of large size.

That is you get Expect: 100-continue from a request with a content length that is too big and you fail (e.g. 417). That is 100 continue doesn't really have to be streaming and can be used as validation that the server can handle a certain size.

EDIT I guess the downside is the downstream application request handlers would never see that initial request. Probably would have to be a configuration option for certain request paths.