by mpweiher · 5y ago · 0 comments
Yes, it is crazy inefficient.
At Wunderlist, we launched WL3 with something like 1K rails boxes on AWS, running a few services. During the launch, my fun was tracking when we reached user/box parity :-)
But it did work.
After a while, we replaced each of the hundred+ rails boxes per service with 2 Scala instances per service.
Also worked. No change for users.
The FP folks should be forever grateful to Ruby for making their languages seem fast in comparison.
At another company where I consulted, for a web content management system, the rails devs were super excited to get the performance up to slightly below one second per request.
We got much better than that 2 decades earlier, running a CGI-Bin (no fast-cgi, so complete restart on every request) that completely re-initalised its Oracle DB connection every time etc. On hardware that was a small fraction of the performance of today's boxes.
If that was the case then Rails was their least important problem.
At the prototyping stage back-and-forth with the client I write VERY rudimentary Rails code, n+1s be damned, but I don't remember ever seeing a second long request.
If you had 20 instances, that is under 2 requests per second per instance.
I don't know what each request does of course, but it might be worth asking if each one should really take a billion clock cycles to complete.