- 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 the whole ecosystem. I depend on Google for both Gmail and Android, so being locked out would be a disaster. To use Google Cloud, I'd basically need to migrate out of Google in other places, which is a huge initial cost.
Both of those are basically risks. I'd much rather overpay $20-50/month than having a small risk of having to pay $100k or being locked out of Gmail/my phone. I cannot have a $100k bill to pay, it'd destroy everything I have.
Also I haven't needed it so far. I've had a Node.js project on the front page of HN, with 100k+ visits, and the Heroku hobby server used 30% of the CPU with peaks at 50%. Trying to do the software decently does pay off.
In fact, I recently shut down a personal App Engine service I had been using for myself for a few years just because of this paranoia. The service was not doing anything illegal, just crawling a few websites (forums, ...) I like and sending me emails when there are interesting updates. But you never know if they might determine my outbound traffic is suspicious. I also started the long process of moving my main email from a @gmail.com to a @custom.domain that currently forwards to gmail, just in case I get locked out.
It is quite bizzarre that this is the reputation google gained for themselves.
Agreed. I often second guess my usage of various Google apps and services since I don't want to trigger some process that I would have no way of ever knowing.
The recent case of someone getting banned from using Apple Pay comes to mind (https://news.ycombinator.com/item?id=20841586)
You can also rate limit some APIs.
https://cloud.google.com/billing/docs/how-to/notify#cap_disa...
> You might cap costs because you have a hard limit on how much money you can spend on Google Cloud. This is typical for students, researchers, or developers working in sandbox environments. In these cases you want to stop the spending and might be willing to shutdown all your Google Cloud services and usage when your budget limit is reached.
I don't think the alternatives are nearly that expensive. Vultr, DigitalOcean and others have virtual private servers for only $5 per month. They're small instances but totally fine for side-projects. I run a cheap $5/month VPS and it was able to withstand my project making the HN front page without issues. I don't use Google cloud hosting for the same reasons as you, I don't want to have too many eggs in one basket.
In our modern cloud age, I think we've forgotten how much a single box can actually handle (and how few of us actually _need_ to "scale" from day one). Hacker News front page isn't really that much traffic in the grand scheme of things. My $5 DO instance handled it without a sweat. Hell, even "real" projects can still work under this approach. A $20/mo DO box, sqlite, and a few shell scripts can get you shockingly far ^_^
- Hobby server, at $7/month
- Database, there are many but add another $5-$15/month
- Redis, either $0/month or $15/month, depending on the needs
If your hobby project goes down for a while nobody will remember that and having to pay $100k will make you remember that for an eternity.
> The service will create more and more instances of your application up to the limit you defined
The Cloud Run docs confirm an instance maximum can be set and the price per instance can be less than $5/month.
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 think some folks may be overestimating their ability to put a dent in Google's infrastructure.
1 CPU
2GB memory
80 concurrent requests per container instance
1000ms execution time per request
5kb outbound network bandwidth per request
100 million requests per month
$120.19 per monthWhat if we bump it up to 100kb per request? In my experience only initial requests end up being enormous, especially in single page apps. But to be fair some folks may not have time to optimize. That still only brings the monthly bill to $1,071.48
Then again that second estimate probably isn't relevant since I typically host my static data on a CDN.
If you give me $1071-$120 = $951/month forever for optimizing an app once I'll optimize it for you :)
In just minutes I had passed free quota and here I have been lucky because I have checked console.
If I have left that version (and I have been sure it is just innocent commit) for a few hours running I would be up for a surprise.
For me, this is the main reason I try not to use any Google products, except for Gmail and Android. For mail, I started to migrate away from Google to reduce risk of being locked out.
It’s what I do since year, basically for every customer I work, I create a new account and even share the credentials with the customer (if he wants it).
Same with Amazon accounts and AWS bills for that matter.
I understand the concern though... and using separate accounts is probably best practice.
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 real material world” where you have to pragmatic, I think many of them fail to realize that on a computer you don’t have to give up certainty the way you do in “the real world.”
> 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.
Also, show us how you would rack up a $100k bill for a side project that receives a traffic spike. It's simply not realistic.
Auto-scaling magic is lovely in theory, but in practise it is hard.
Annecdata - a video streaming startup here in Newcastle that enabled DJs to stream live sets was used to illegally stream some football games. The subsequent bandwidth bill killed the startup. Yes, they got some things wrong with their tech, and security, but that's the danger that put's people off using "clever" services.
Personally I don't think I can go straight up Heroku or DO because I like things like firestore/dynamo, S3, etc etc. But this is pushing me to move everything I do over to AWS. The only thing is I am very comfortable in GCP, so that would kind of suck. bleh.
I wonder how hard would it be to run a script that checks your balance e.g. every 15 minutes, and shuts down public access to your services when a certain threshold is triggered. I wonder if a ready-made service for that exists in cloud providers' offerings.
It's surprising that no major cloud provide prepaid option, which would be handy for such.
Welcome to US healthcare. Happens daily! :)
It is a best-practice to have a GSuite account instead of a consumer-grade Gmail account to manage an associated GCP account.
It is a bit onerous for a hobbyist, admittedly. But if its anything more ambitious than that, do you _really_ want Google scraping the contents of your email while you build the Next Great Thing? Try not to use a consumer account.
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)
If your only payment method is credit card, IMHO allowing a past due account to continue generating cost is a very risky move and an easy target of abusing (imaging stolen credit card etc).
Disclaimer: I work for Google Cloud as SRE and have first hand experience dealing with past due account (it was highly manual and not automated).
Or think again if you really need 'infinitely scalable bla blah' for personal project on a small budget.
Since it wasn't really worth debugging what went "wrong" it got chalked up as a learning experience and moved back to the laptop where its happily running. If it dies/whatever its no big deal, just a git clone;./runme; and it rebuilds the whole database and creates another web facing interface.
The IaaS guys are masters of marketing. They have convinced everyone that their offerings are less expensive and more reliable, which repeatedly is proven to be false in all but the most dynamic of situations. In this cases its saving $7.99 a month over a unlimited site shared hosting godaddy/whatever plan. Just in case it might need to scale a lot, in which case your going to be paying hundreds if not thousands in surge pricing.
No thanks...
I have a side project that uses AWS at the moment, and while stuff like serverless RDS instances are really cool, it scares me that somehow amazon is going to have a bug which empties my checking account. I've read as much of the documentation as I can find and have done everything I seem to be able to to prevent this from happening according to AWSs documentation, but it sill worries me.
In fact here is a banking feature I'd love to see: per merchant daily spending limits. I would love to be able to tell my bank that amazon is allowed access to up to $20/day or something of money until they get rate limited and I have to intervene.
Uh oh I better stop before I start advocating for the blockchain, haha
Seems like this is a huge dealbreaker. You cannot be expected to perfectly audit your side project for security. Suppose someone finds a remote code execution and starts mining Monero on it. Or someone just points a botnet at it. You could be on the hook for an unlimited amount of money.
Might as well just install Kubernetes on a monthly-fee VPS and pretend you're using GCP.
It boggles the mind that AWS and GCP don't offer a payment cap - for that reason alone, I wouldn't go near them for side projects.
1. notify me so I can ok continued service 2. start throttling usage 3. turn off if #1 has not responded and set new limits etc.
https://www.nolo.com/legal-encyclopedia/limited-liability-pr...
EDIT: This comment is based on the assumption that the parent was trying to start a side business. I'm certainly not advocating fraud.
If you do allow some kind of ordered shutdown of service, what is the UX going to look like? What is the API going to look like?
Having a cap is not an easy feature to design or implement. And on a backlog, it is going to be a “multi quarter, low impact” item—meaning it will never get built.
Maybe just a simply array with the list of services to be shut down in the order provided? This should be enough for hobby and smaller projects, bigger projects will have plans/people in place anyway.
It is not that they can't do it - we are talking about a company with insane technical ability and resources. It is just that they don't want to do it.
They force-upgraded the java version. The problem was their their own libraries didn’t work with the new version and we had to rewrite a ton of code.
It ended up being insanely expensive at scale.
We were totally locked-in to their system and the way it did things. This would be fine but they would also deprecate certain things we relied upon fairly regularly so there was regular churn to keep the system running.
Support was extremely weak for some parts of the system. Docs for java were outdated compared with the python docs.
Support (that we paid for) literally said to us “oh... you’re still using appengine?”
Finally, they can jack up the pricing at any time and there really isn’t anything you can do - you can’t switch to an alternative appengine provider.
Certain pages in the management console were completely broken due to a js error (on any browser). In order to Use them i had to manually patch the javascript. Six months after reporting it several times and it was still broken.
Oh, and when we got featured on a bunch of news sites, our “scalable” site hit the billing threshold and stopped working. No problem, just update the threshold, right? Except it takes twenty four hours (!) for the billing stats to actually update. So were were down on the one day that “unlimited scaling” actually mattered to us.
I’m never again choosing a single-vendor lock-in solution. Especially since it’s not limited to appengine - Google once raised the fees for the maps API from thousands a year to eight figures (seriously) a year with barely any notice.
App Engine was the very first PaaS, came out before Docker, and did things very uniquely in order to try to only allow scalable apps. App Engine standard has to explicitly create special environments for each of their runtimes, and that's slow and expensive. Services like Datastore and Memcache were tightly coupled.
Cloud Run fixes all that. It's just a Docker container that listens on the PORT env variable. Use whatever runtime you want. Run the same container locally, or on another cloud provider. The other services like Firestore or Memorystore (Redis) are truly optional and external.
Cloud Run is what lets you avoid single-vendor lock in, but still get from 0 scaling.
Cloud Run, however, uses standard containers, so as long as you don't use Google proprietary stuff on the backend it's relatively easy to move. As the article mentions, it's useful for low-traffic projects, and if they pick up you can move them to full-time instances.
Certain early decisions are still biting GCP.
Well, there's an open-source API-clone of appengine...
The only complaint I have with Cloud Run now (after many usability updates since the initial release) is that there is no IP rate-limiting to prevent abuse, which has been the primary cause of unexpected costs. (due to how Cloud Run works, IP rate-limiting has to be on Google's end; implementing it on your end via a proxy eliminates the ease-of-use benefits)
---
How to keep a Cloud Run service “warm”?
You can work around "cold starts" by periodically making requests to your Cloud Run service which can help prevent the container instances from scaling to zero.
Use Google Cloud Scheduler to make requests every few minutes.
Does my application get multiple requests concurrently?
Contrary to most serverless products, Cloud Run is able to send multiple requests to be handled simultaneously to your container instances.
Each container instance on Cloud Run is (currently) allowed to handle up to 80 concurrent requests. This is also the default value.
What if my application can’t handle concurrent requests?
If your application cannot handle this number, you can configure this number while deploying your service in gcloud or Cloud Console.
Most of the popular programming languages can process multiple requests at the same time thanks to multi-threading. But some languages may need additional components to do concurrent requests (e.g. PHP with Apache, or Python with gunicorn).
From the pricing (https://cloud.google.com/run/pricing):
12 * ($0.00002400) + 12 * (2 * $0.00000250) = $0.000348 per text
...and that's assuming you go over the free tier limit.
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.
I realize some applications are very heavy on the app side and light on needing to hit the DB, but in my experience, that isn't very common.
So if you are serving up just a few megabytes and hit a few million page views you may find an AWS bill for a few thousand dollars.
Another advantage not stated by others is that cloud run (mostly) adheres to the KNative API spec. This allows you lift-and-shift your application from cloud run to a Kubernetes cluster with the KNative plugin installed, a feature you can’t find with any other serverless product
To me with my limited understanding this seems like just another step.
Now granted when it comes to work, I'm using docker with specifics that I know why I would want / can specify with docker ... but for personal projects this ever comes up for me.
But otherwise for personal projects it just never comes up.
Yet on the other hand when it comes to various examples I see more and more that involve docker where, I'm not sure it needs to / what the advantage is.
Obviously there must be some strategic choices / advantages I'm missing.
You can use containers on Heroku, by the way.
When will everyone understand that google cloud (money earning product) is different to all the other free products
Google Cloud has an official deprecation policy. If a product is labeled GA, Google Cloud guarantees that the service will continue running for at least 12 months since the announcement of deprecation.
They're boilerplate and don't add to the discussion.
> The service will create more and more instances of your application up to the limit you defined
The docs confirm an instance maximum can be set and the price per instance can be less than $5/month.
So far so good. Managed to host gitlab, prometheus, grafana and ghost working this weekend, which I'm pretty chuffed about.
Not as clean as OP's, but the intention was learning, so sacrifices on convenience are acceptable.
You’d be surprised how much you can handle with a single beefy VPS or dedicated.
I'm paying 7USD for a 16gig/4 core ryzen I snagged on a special. That's a good 10x off from what big cloud would give me.
...down side is it needs to be engineered for "provider may disappear overnight" so backup strategy needs to be on point.
Unfortunately Cloud Run obfuscates when a cold boot is necessary.
There are also features like Firewall API that's lacking in Cloud Run right now.
One downside of App Engine (due to its 10+years of history) is that one GCP project can only have one App Engine app in a single region, and you can't change the region after it's created. You can have arbitrary number of Cloud Run service in one GCP project, each can be in different region.
It's also harder to take a Infrastructure-as-code approach on App Engine as there's no easy way to diff between the deployed version and the intent (in Cloud Run, you can use the container image hash for that purpose).
Disclaimer: SRE working on App Engine and Cloud Run.
I’m generally very underwhelmed by Azure offerings, but ACI is one of the few that actually lives up to what is advertised.
* the cost seems net-net similar to App Service, but more granular. So I can go this route and get slightly more flexible pricing, but at the cost of some arbitrary limits on assignable CPU/memory.
* it's easy to wander into Azure Container Service stuff accidentally, and that has "deprecated" plastered all over it. Shame the naming doesn't separate them more clearly.
An aside, but I totally agree that App Service is way too expensive for the piffling amount of CPU/RAM they provide, even though I acknowledge the platform side of the offering is excellent.
You can specify where to deploy to in a config file. Pretty cool stuff.
I don't understand this obsession with running projects for "nothing" and contorting software architecture to do so.
$5/mo for a digital ocean droplet or $50/month for a a beefier VPS (or even dedicated hardware if you know where to look[0]) is not much compared to the normal monthly expenditure of people in tech on average.
If it was all for convenience/efficiency that'd be one thing, but learning "google cloud run" teaches you nothing about system maintenance, limits your understanding of the full stack, and encourages a myopic view of development, all so at some point when Google/AWS/Azure raises the temperature of the water in the pot everyone starts wondering "how did running software get so expensive?".
It really isn't a lot, but some people aren't in SF where they make massive profit. In more rural areas in the US, non-senior engineers can make ~$60k-$80k. In non-US roles, that's even lower. I can see this price range being meaningful.
Also, I know you can get cheaper with this, but if your goal is to spin up MVP's ASAP, you don't care to work hard to optimize ever penny out of your infrastructure. This is a nice breakdown, and I'll probably use it for the current project I'm spinning up as a test.
This sounds a lot like aws lambda (except nicer thanks to just running any container). In AWS’s case, you need to pay extra for RDS, redis, and any other persistence.
IF you want, you can still have it by use "Cloud Run for Anthos", and deploy your container to your GKE cluster with the same Knative API. This allows you to have more control on memory/CPU etc.
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 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?
More importantly, with those hypothetical numbers, you'd stay well within the free tier for compute.
Netlify has basic DB/Identity/Lambda support so I’m guessing it could replace this entirely.
I’m using it only to host static websites at the moment.
Cloud Run is to run a fully custom server, as in an API. It can obviously do more than Netlify, however Netlify really excels at static + some server code, while Cloud Run is extremely flexible (server in any language, more resources, etc)
Once you exceed the free tier, though, no doubt it's much more expensive than GCP/AWS.
I don't understand what would make it exponential as opposed to merely linear with traffic.
There's nothing in their pricing documentation to suggest this.
Just reading this line makes you suspicious: "I have built hundreds of side projects over the years "
really? Hundreds?
And then below:
"I am yet to have a side project go ‘viral’"
Out of hundreds of projects over the years, none of them went viral?
And if you look at his "blog" you will see it has 3 entries in total: https://alexolivier.me/
HN guidelines:
> Please don't post insinuations about .. shilling.. It degrades discussion and is usually mistaken. If you're worried about abuse, email us and we'll look at the data.
Also: every blog starts somewhere. Plenty of stuff in the author's GH and linkedin, both linked from TFA.
I've used ECS a few times, it's pretty nice.
so i would suggest AWS. API Gateway + Lambda. It's basically free for side-projects and the setup + operating it is trivial. It also scales (and you're going to have to shell out real money) if you were to receive a lot of traffic.
Yes, that makes about as much sense as people who can't get over their favourite RSS reader, 13 years on.
And I don't have to worry about accidentally unplugging my server or downtime for OS upgrades.
My 3 side projects got reddit frontpaged (also here) and I got better at handling it. Fortunately I always had scale in mind (at peak got thousands of requests per second) but the first time was not a pleasant experience because I would have to pay more than I could if that kept going on. Fortunately I found a solution while keeping my site online and over the time the project paid me very handsomely. If I didn't plan ahead, those would be dead in the water.
After a lot of double-checking on my part, I was finally convinced that Cloud Run messed things up (in my case: A Content-Type header was changed from ThingsISend to text/html and broke every client). The issue tracker is hard to find and more or less abandoned, SO wasn't helpful (but had people that .. love Google Cloud Run and didn't believe me) and only after tweeting a bit someone looked into it.
The issue is fixed now, which is nice. The way to get there was ... questionable?
Scale to zero + instant deploys would make cloud run a great candidate for staging environments deployed on every pull request but it's not quite there yet.
> As long as you have architected your application to be stateless - storing data in something like a database (eg CloudSQL) or object storage (eg Cloud Storage) - then you are good to go.
Won’t this just defer the scalability issue to the SQL part of the application? It’s nice that the stateless REST part can be scaled almost infinitely, but if the SQL part doesn’t offer the same scalability, what’s the point? Last time I looked, CloudSQL didn’t offer this kind of scalability.
When all you give the service is a container, how dos it know how to scale your project?
I presume it gives it more CPU and more RAM automagically but does that really provide "at scale"
I think of "at scale" to mean really a lot of traffic.
Spinning up new instances if your container is possible, but I think I would like an API where code can somehow interact with the scaling mechanism.
I guess "stateless" gives us some information.
(For same reasons as other comments, I don't want to use another Google service for this, risk of being locked out, etc.)
Even the example he wrote is similar (probably longer) to a small guide I wrote for deploying to gae.
> As long as you have architected your application to be stateless
The Serverless Framework on AWS Lambda though are more mature to do that. One of the biggest gotchas is using just one aws lambda function with the entire web server instead of doing one aws lambda for each endpoint.
If they are truly stateless then the bottleneck will probably be the database, anyway.
For anyone starting a new app I recommend just building apps that are TRULY serverless. Then you can make them client-first, work offline, not tied to on one particular domain name, support end-to-end encryption, be embarassingly parallel and scalable, and take an activist position against continuing centralization.
A fuller exposition is here, so I don’t have fo write a whole mountain of text: https://qbix.com/blog/2020/01/02/the-case-for-building-clien...