4 ms·
> 2.8M active connections per server I think this is a use-case best left for nginx and other proxies written i C. Java should be easy to use. Leave weird sp
by silvestrov 4y ago
> 2.8M active connections per server
I think this is a use-case best left for nginx and other proxies written i C.
Java should be easy to use. Leave weird specialcase programming to special tools. Don't try to make java solve all problems.
Java nio became a monster of complexity which made implementing an http server much more complex that it should be.
- gpderetta 4y agoWith modern hardware 2.8M doesn't seem a particularly large number. Modern Java VMs are pretty efficient (more so after project Loom), so I don't see why Java wouldn't be appropriate for this use case. In fact efficient virtual threads would allow avoiding nio and provide a fast and sane blocking interface. Note: I say this as a C++ programmer.
- deleted 4y ago[deleted]
- xxs 4y agoHaving that many connections requires tons of buffering and effectively manual scheduling (or clients can experience latency issues). At the very least non-blocking io allows to tune the scheduling depending on the clients behavior and importance. Personal experience: tons of java nio and lock-free structures.
- duped 4y agoRightly or wrongly, that's exactly what Java is designed for. Write once, run anywhere. It's not just for HTTP servers and web services.