Live data from Hacker News

Deploy your side-projects at scale for basically nothing – Google Cloud Run

alexolivier.me

171–180 of 397 posts

Re: Deploy your side-projects at scale for basically nothing – Google Cloud Run

#172

As an illustrative of pricing: If your deployment can run in 256MB of RAM w/ 1 vCPU, handles an average request in under 250ms, transfers 200kb or less per request on average, and you get 2 requests/minute on average to your site: The cost is around $2/month USD, which I feel is a more likely scenario for a side project vs the “pennies a month” the OP claims.

I have gone serverless for a Vue frontend app I deliver with Cloudflare Workers Sites and with a DigitalOcean S3 Space serving all images. However I'm still very reluctant to use Google Cloud Computing or any similar Azure/AWS solutions for its backend because it just seems pretty expensive to me.

I can get a vServer with 48 Gb RAM, 10 vCPUs and a 800 SSD with a 1000 Mbit/s connection and unlimited traffic for 20€ a month and run my MariaDB and Redis database on the same machine as my other containers.

Even if the vServer only runs at 25% on average the same performance with GC would cost me 150€ for the CPU, 77€ for the RAM (with free tier already included) and that is still not accounting for the traffic. And I would have to host the MariaDB instance elsewhere (which adds latency). And Google Cloud has very few data centers in Europe so it'd not even be near my main market.

In this case Google Cloud Run (with worse performance) would cost me like 15x more than running a vServer. That's not a price I'm willing to pay to go completely serverless or to avoid downtime at all costs. Or am I missing something?

Re: Deploy your side-projects at scale for basically nothing – Google Cloud Run

#173
post #75

Earlier quoted context omitted.

That's not a bug... that's a 'feature'. Interestingly, AWS will not cut you off for non-payment (we had an issue with finance and were 250k in the red by the time we got the first 'Is there any issues over there?' email)

This sounds like a short term 'thinking'. If there are a few stories on the internet (and there are some in this very thread) about developers getting burned by this 'feature', it would turn off a lot of potential users in the future. It would make sense to be transparent and give tools to strictly control usage/billing - both in terms of trust and money.

It is. I'm using free there to build and host my projects. If/when I exceed the free tier I'm not making a billing account unless I can set a max bill. I'll sooner rewrite everything to run on bare metal that has a fixed monthly cost.

Re: Deploy your side-projects at scale for basically nothing – Google Cloud Run

#175

Earlier quoted context omitted.

Cost is not only based on the number of instances. From a quick search: https://www.jhanley.com/google-cloud-run-pricing/ Understanding the cost of these services is not easy at all, especially for extreme cases/situations. And a calculator/estimator won't fix the problem. That is why I love the fixed $X/month where there's no room for surprises.

I hope GCP/AWS add a max spend ability. Until then it's complexity of pricing model vs time spent on OS and database management. To each their own.

It's why I'm on digital ocean. Cheap, but good quality service that's comparable to the big boys and it's capped. $5/month is perfect for me

Re: Deploy your side-projects at scale for basically nothing – Google Cloud Run

#176

As an illustrative of pricing: If your deployment can run in 256MB of RAM w/ 1 vCPU, handles an average request in under 250ms, transfers 200kb or less per request on average, and you get 2 requests/minute on average to your site: The cost is around $2/month USD, which I feel is a more likely scenario for a side project vs the “pennies a month” the OP claims.

"2 requests/minute on average to your site" is a bad assumption for a relatively unpopular side project. More importantly, with those hypothetical numbers, you'd stay well within the free tier for compute.

A request is not a visit. Each visit might have a up to a hundred requests (or even more when showing live data and caching a PWA on first visit for example). That would translate to one user per hour or two which even unpopular side projects can get. But you're right about the free tier of course.

Re: Deploy your side-projects at scale for basically nothing – Google Cloud Run

#177
post #150

This article fails to mention the issue of needing a database. It doesn't matter how seamlessly your application can scale if your data backend won't scale with it. They mention Cloud SQL, which is of course instance based and would run into scaling issues if your app got suddenly hammered. Not to mention, the cost isn't $0 if your app gets 0 traffic, you are going to have to pay to keep that running around the clock…

AWS has Aurora Serverless (https://aws.amazon.com/rds/aurora/serverless/) for that purpose with MySQL and Postgres compatible engines. But I haven't heard anyone using it for side projects yet.

Re: Deploy your side-projects at scale for basically nothing – Google Cloud Run

#178
post #164

I have used it for work-related reasons and indeed the service is quite nice. But I don't use Google Cloud Run for personal projects for two reasons: - No way of limiting the expenses AFAIK. I don't want the possibility of having a huge bill on my name that I cannot pay. This unfortunately applies to other clouds. - The risk of being locked out. For many, many reasons (including the above), you can get locked out of…

> No way of limiting the expenses This pattern seems common among business people: things working in the common case vs things working in corner cases, it’s how you end up with consumer windows running critical machines. I’m always shocked and moderately disturbed when I see it but I guess we all need to accept the reality that most people are very pragmatic. It makes sense, most people’s intuition comes from “the re…

Loss aversion[1] describes the phenomenon pretty well:

> Humans may be hardwired to be loss averse due to asymmetric evolutionary pressure on losses and gains: for an organism operating close to the edge of survival, the loss of a day's food could cause death, whereas the gain of an extra day's food would not cause an extra day of life (unless the food could be easily and effectively stored).

For lots of companies an accidental over-use of tens or hundreds of thousands of dollars is an annoyance, but for a single person that could bankrupt them. I generally avoid programmatically interacting with cloud providers on my own time for exactly this reason. One mistake in a loop can get expensive fast.

[1] https://en.wikipedia.org/wiki/Loss_aversion

Re: Deploy your side-projects at scale for basically nothing – Google Cloud Run

#179

Your liability is not capped anywhere. I better stick to 5$/mo DO for my side-projects.

You can actually specify maximum number of instances https://cloud.google.com/run/docs/configuring/max-instances as well as max requests handled by instance at a time (https://cloud.google.com/run/docs/about-concurrency).

Re: Deploy your side-projects at scale for basically nothing – Google Cloud Run

#180

AFAIK, PaaS solutions like heroku have a similar way of working, at least for side-projects. Here, you deploy a container and Google runs it somewhere and Heroku containerizes your application every time you push it. Similar to here, Heroku's free hobby containers also go to sleep in ~30min inactivity.

Heroku's "hobby" is $7/m while "free" is $0/m. There's no "free hobby":

https://www.heroku.com/pricing

Post reply on HN