It is true that spending time optimizing queries will give you more benefits than JIT though. CPU is not the bottleneck for most Web tasks.
It is true that spending time optimizing queries will give you more benefits than JIT though. CPU is not the bottleneck for most Web tasks.
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.
Even a single n+1 query can really hose performance by burdening the entire database.
ORMs can be bad, but it's not fair to blame them "just because".
I agree knowing SQL is very important, even if you use an ORM, sometimes you might need to roll up your sleeves and write some SQL (not to even mention knowing how to EXPLAIN queries, use indexes, etc).
Nowadays most things are abstracted away. A similar thing happens with IDEs, if your IDE takes care of compiling and building everything for you, then you don't understand how everything works under the hood. Is that a bad thing? It depends.
If you show HTML to a junior JS dev he'll say it's React, lol. I think there's no way escaping the abstractions in modern times.
At least there are tools to warn you about n+1 automatically https://github.com/flyerhzm/bullet
Btw. I haven't seen Rails or Ruby on this list in the top 50% for a while:
https://www.techempower.com/benchmarks/
I would prefer hard data as opposed to "this is a legend".
UPDATE:
Rails is number 399 out of 439, having 0.3% performance of the top frameworks in a plain text task.
I know, facts hurt.
While it's true Rails will use more ram than other options for a given traffic level, many of us have scaled it just fine.
The techempower benchmarks aren't particularly useful for anything other than forum warrior style arguments. They don't really measure a realistic workload.
Your last sentence is entirely unnecessary.
Everything I said is factual. Many of us have built successful startups on rails. I'm a very pragmatic person in general and abhor the cheering and jeering dynamic you're actively courting in this thread.
Your concerns are further diminished ~ every two years. Please re-evaluate your assumptions on that timeline.
This position was established by the company that owns the one of the largest server farms in the world? Are they looking to save on a few x-large instances? Seems short-sighted to me.
Sub 50ms response times are very achievable with Rails.
Throwing another server at it is a very reasonable response. Especially when you want your team to remain productive in a cohesive, batteries included framework.
Plenty of real-world Rails examples to demonstrate this.
https://mobile.twitter.com/brandonhilkert/status/13973190133...
The fact that it is being used at Shopify and Github doesn't make Ruby Rails Fast. It just means their Business Model fits its usage COGS. Especially true if you are a SaaS with low / no Free Tier or Non-Freemium model.
Now that Shopify are spending hundred millions on cloud it absolutely make sense for them speed up Ruby Rails. I just hope it wont end up being like Twitter.