3 ms·
Scaling and load balancing.
by golemotron 3y ago
Scaling and load balancing.
- Berone 3y agoFrom a business perspective, unlocking this precision for infrastructure is only worth the investment at the highest levels of scale.
- treis 3y agoThis is one of those things that was true in like 2008 but is no longer true in 2023. Scaling a monolith is slightly more expensive in memory consumption but in practice it's irrelevant for most cases. In this particular case it's worse due to how Rails works. Usually people deploy one Rails thread per core and that core is blocked by the thread. If that's the case when Service A calls Service B, Service A is blocking a core and waiting until Service B completes. That's effectively doubling resource consumption during that call. You have one server waiting on another server to do work it could have done itself.
- zrail 3y agoRuby threads suspend on IO so a blocking HTTP request is very low cost.
- rco8786 3y agoI don’t think most modern Rails deployments have this problem anymore. Puma does pretty well with parallelization
- treis 3y agoYeah, and with Fibers things are getting even easier to do. But there are other performance issues and ultimately the benefits are minor.