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 comments

7

u/stringbet Feb 14 '22

Eh.. there are reasons to do it. When you're handling 1m requests/s, putting the SSL on your LB is a significant CPU burden which makes scaling harder. Pushing SSL back to your server pool allows the LB to operate in Layer 4 and thus it can handle a lot more traffic.

5

u/elliotbarlas Feb 14 '22

I've never heard that argument before. Load balancers are horizontally scalable, so while it does place a greater burden on the LB, I don't think that's actually problematic.

Also, HTTP aware layer 7 load balancers are indispensable.

1

u/lambdacats Feb 15 '22

Why are L7 load balancers indispensable? Any time I've got requests for it has been because sticky sessions are needed due to poor design.

2

u/elliotbarlas Feb 15 '22

AWS CloudFront, Application Load Balancer, and API Gateway are all L7 proxies. They provide essential services. I'm not sure why sticky sessions came to mind. That's not a feature I use personally.

1

u/lambdacats Feb 15 '22

Okay, but I'm still wondering what essential services you need in L7? It's the only argument I've heard for wanting L7 load balancing.