Re:A taste of pavex, an upcoming Rust web framework
by Waterluvian on Saturday December 31, 2022 @11:07AM
(#34197662)
Is a thread per request scalable? Aren’t most of those threads just waiting for I/O? I guess thousands of concurrent requests via thousands of threads isn’t a big deal.
[ Parent
| on HN ]
Re:A taste of pavex, an upcoming Rust web framework
by marcosdumay on Saturday December 31, 2022 @12:59PM
(#34198888)
You mean at the application layer?
There never was any problem scaling things at the application layer. You can use almost any architecture there without issues. All the bottlenecks are elsewhere.
Re:A taste of pavex, an upcoming Rust web framework
by vbezhenar on Saturday December 31, 2022 @03:58PM
(#34200674)
It's reasonably scalable. Operating system can deal with thousands of sleeping threads just fine. And I don't need more than that (on a single machine anyway).
Re:A taste of pavex, an upcoming Rust web framework
by aseipp on Saturday December 31, 2022 @04:47PM
(#34201108)
Yes, you can run absolutely massive systems with very high throughput and high concurrency using only OS threads and "normal" synchronous programming, if done correctly. However it's generally a pain in the ass because most languages often have their own threading models that may have their own limitations or interaction-with-the-OS quirks, while in C or C++ you're typically on your own for like, all your dependencies including trivialities like thread pools and stuff. And all newer languages tend to instead design their I/O ecosystems around asynchronous stuff. So you have to choose your poison. But handling massive systems always requires a bit of special care anyway.
You will often encounter many other bottlenecks that hold your system back. There are other concerns like latency and utilization to care about. But assuming a purely "compute/IO" driven data plane, yes, you can scale synchronous APIs with threading quite far.