Hacker News new | ask | show | jobs
by treis 1110 days ago
This 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.

2 comments

I don’t think most modern Rails deployments have this problem anymore. Puma does pretty well with parallelization
Yeah, and with Fibers things are getting even easier to do. But there are other performance issues and ultimately the benefits are minor.
Ruby threads suspend on IO so a blocking HTTP request is very low cost.