Rails running costs

Thank you for sharing these stats.

First, I would say that unless you are trying to build a web app larger than Shopify or Github you should not worry about Rails itself…

Second, from my personal experience, I have scaled Pushpad to thousands of dollars per month on bare infrastructure on DigitalOcean. I think that the real difference is the cost of the platform: if I used the DigitalOcean App Platform instead of infrastructure, or, even worse, Heroku, then I would spend tens of thousands of dollars per month, which would be unacceptable for our current business.

Basically with a PaaS (like Heroku) you spend 3 or 5 times the cost of infrastructure (IaaS).

Basically if you want to reduce the server cost up to 80% compared to Heroku (e.g. spend 5k instead of 25k per month), then you should use bare infrastructure (droplets) or Kubernetes (when you go above 10 large droplets).

If you want to get started with Kubernetes and Rails, which is a cheap and scalable solution take a look at this guide that I wrote:

https://kubernetes-rails.com

5 Likes

Obviously this is a ‘piece of string’ question, but a single server on Digital Ocean, managed by Hatchbox.io with some sensible caching will take you a long way.

I think Hatchbox is $15/month, and my $20/month DO server handles a couple of small sites without blinking. The main site on that server has ~16k monthly users and right now ~420 open websockets.

CPU runs at about 20% most of the time.

You can scale up quite a long way with more powerful single servers for not much money. ($80/month would essentially give me 4x this cpu/memory)

3 Likes

Hey Marco - thanks for this informative post! Thank you also for the Kubernetes and Rails guide.

I guess IaaS reduces platform cost, but I’d think that those cost savings are cancelled out by cost of server admin time and having to do things oneself? I don’t have figures at hand, but I am starting to think that Paas e.g. Heroku will ultimately save money for all but really large projects? I think that throwing in an auto scaling solution like Rails Autoscale on Heroku would do the same work, and be cheaper than, having a dev ops team monitoring traffic and responding to spikes, backing up databases etc?

P.S: Pushpad looks interesting.

Thank you for sharing this. Hatchbox gets another mention - and it sure does look like a viable option for scaling Rails without breaking the bank.

Edit: Wow! I hope you don’t mind me posting a screen shot of a customer testimonial from Hatchbox. THIS is exactly the sort of thing that prompted me to start this thread. Having a website which is not necessarily monetized, then having it grow to where running costs can be a pain point. For example, Leaf at itch.io scaled Itch to hundreds of millions of requests - on a US$20 VPS using his MoonScript/ Lua/ OpenResty-based web framework, Lapis. Leaf previously built web apps using Rails and when he wrote Lapis, he wanted to solve some pain points he noted while using Rails - performance and resource usage no doubt being some. Itch is monetized on a pay-what-you-want model. At that rate, even if less than 1% of users shared revenue with the site, cost would not be an issue. So, this is really what I wanted to know, and not to attack Rails as @tarellel insinuated. Screen Shot 2022-01-01 at 1.45.44 AM

So, I’ve spent some time looking at Hatchbox and I’d say it is one of the best solutions I have seen outside of using Heroku.

For the bootstrappers amongst us who’d rather spend their time on building applications and biz dev rather than sweating server setup and admin, Hatchbox seems to check all the right boxes. The fixed pricing model and clustering capabilities also help to keep costs down while extracting maximum value from hardware. I dig :white_check_mark:

Well done, Chris :trophy:

1 Like

I also have to add that the creator of Hatchbox, Chris Oliver (his handle everywhere is excid3, you may have seen him around) has amazing support. He always answers my emails promptly. I can’t speak highly enough of him and his services.

2 Likes

Indeed. The first time I visited the Hatchbox website, I recognized the guy in the home page video (whom I now know to be Chris) from a YouTube discussion with DHH and two other guys on Rails 7. I’ve also been watching GoRails videos on YouTube and only realised it was Chris after posting this thread :bulb:

1 Like

Well, that makes my day! Thanks for the kind words and glad Hatchbox has been working well for you! :sparkling_heart:

3 Likes

I didn’t know you were around here - but I’m glad you are!

Thank you for all you do for the Ruby and RoR communities.