4 ms·
Postgres can scale to millions of users, but Rails definitely can't. Unless you're prepared to spend a ton of money.
by benwilber0 2y ago
Postgres can scale to millions of users, but Rails definitely can't. Unless you're prepared to spend a ton of money.
- petcat 2y agoFor real. Show me a company that has scaled RoR or Django to 1 million concurrent users without blowing $250,000/month on their AWS bill. I've worked at unicorn companies trying to do exactly that. Their baseline was 800 instances of the Rails app...lol. I'm not going to name-names (you've heard of them) ... but this is a company that had to invent an entirely new and novel deployment process in order to get new code onto the massive beast of Rails servers within a finite amount of time.
- ainiriand 2y agoWe use 5 ec2 instances to serve around 32 million requests per day on PHP, all under 100ms. It is not the language.
- nov21b 2y agoThe language/runtime certainly has an impact. But indeed, in reality there is no way to compare these scaling claims. For all we know people are talking about serving a http-level cache without even hitting the runtime.
- ainiriand 2y agoEach and every request reach the DB and/or Redis. MyISAM is deprecated, but is crazy fast if you mainly read.
- charlie0 2y agoFramework or custom app?
- ainiriand 2y agoRaw php scripts, no ORM either. It has very good abstractions for some logic and for some other parts it is just a spaghetti function. Changing anything is difficult and critical so we are not able to refactor much.
- dilyevsky 2y agoSounds impressive until you realize that there’s 86400 seconds in a day and so even if majority of those happen during business hours thats still firmly under 200 qps per server. On modern hw that’s very small. Also what instance size?
- ainiriand 2y agoc5.4xlarge
- jylasdfasd 2y agoThis is trivial with epoll(7) or io_uring(7). What you are describing "5 ec2 instances" could likely be attributed to language and/or framework bloat but hard to know for certain without details.
- loktarogar 2y agoI've scaled a single rails server to 50k concurrent, and so if Rails is the theoretical bottleneck there, and we base it off scaling my meager efforts, that's only 20 servers for 1 mil concurrent, or around $1000/mo at the price point I was paying (heroku). Rails these days isn't the top of the speed meters but it's not that slow either.
- petcat 2y agoSounds like you made a nice, tight little Rails app. 50,000 concurrent? Oh man, I wish.
- hw 2y ago“Rails can’t scale” is so 10 years ago. It’s often other things like DB queries or network I/O that tend to be bottlenecks, or you have a huge Rails monolith that has a large memory footprint, or an application that isn’t well architected or optimized.
- danmaz74 2y ago"without blowing $250,000/month on their AWS bill". The point is that you don't need AWS for this! You can use Docker to configure much, much cheaper/faster physical servers from Hetzner or similar with super-simple automated failover, and you absolutely don't need an expensive dedicated OPS team for that for this kind of simple deployments, as I read so often here on HN. You might get surprised as how far you can go with the KISS approach with modern hardware and open source tools.
- dilyevsky 2y agoYou ain’t replacing 250k/mo worth of ec2 with a single hetzner server so your “super-simple failover” option goes out the window. Baremetal is not that much faster if you’re running ruby on it, dont fall for the marketing.
- danmaz74 2y agoI never said that you should only have one server on Hetzner. For the web servers and background workers, though, scaling horizontally with docker images on physical server is still trivial. By the way, I was running my startup on 17 physical machines on Hetzner, so I'm not talking from marketing but from experience.
- sparker72678 2y agoWere they running t2.micro instances or something? We're running 270k+ RPM no sweat, and our spend for those containers is maybe 1/100th what you're quoting there. The idea that Rails can't handle high load is just such bloody nonsense. You can build an abomination with any framework, if you try.
- dcchambers 2y ago> Show me a company that has scaled RoR or Django to 1 million concurrent users without blowing $250,000/month on their AWS bill. Can you deploy something to vercel that supports a million concurrent users for less than $250K/month? What about using AWS Lambdas? Go microservices running in K8s? I think your infra bills are going to skyrocket no matter your software stack if you're serving 1 million+ concurrent users.