4 ms·
When people say these apps are IO bound, what they actually mean is that they are memory bound. While Rails is waiting for IO due to its lack of concurrency sup
by jupp0r 2y ago
When people say these apps are IO bound, what they actually mean is that they are memory bound. While Rails is waiting for IO due to its lack of concurrency support and the ubiquitous use of global variables in the ecosystem, a passenger worker is taking up >300mb of memory for a medium sized Rails app. Server memory limits the amount of workers you can have waiting like that, which in turn limits overall throughput per server.
- caseyohara 2y agoThat you mention Passenger makes me wonder how outdated your comment is. The most recent Rails community survey reported only 13% using Passenger. https://railsdeveloper.com/survey/2024/ https://railsdeveloper.com/survey/2024/
- byroot 2y agoThat may be true for very memory constrained platforms like Heroku, but is a non issue at larger scale. Taking your figure of 300MiB per process, and assuming you might want to run 1.5 process per core to account for IO-wait, that's 450MiB per core (ignoring copy-on-write). If you look at various hosting offering, most offer something like 4GiB of RAM per core (e.g. EC2 "general purpose" instances). As for the lack of concurrency support, Active Record has asynchronous queries since a few versions, and is now even async/fiber compatible. So if you truly have an app that would benefit from more concurrency, you can do it.
- pydry 2y agoNo, it just means that they spend most of their time waiting around for database and network queries to finish.
- marcosdumay 2y agoThey mean the app takes data from one place, does a trivial computation, and pushed it at another place. So pushing data around is all the application does. And they don't know both such places are actually faster than the trivial computation because their code runs way slower than the ones at the origin and destination.