News for hackers. Stuff that matters.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by onion2k on Thursday December 10, 2020 @06:49AM (#25372650)
The fact that cloud providers don't have a simple "This is how much I can afford, don't ever bill me more than that!" box on their platforms makes development a lot scarier than it really needs to be.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by donmcronald on Thursday December 10, 2020 @07:30AM (#25372962)
This is my worst nightmare. Lol. I guess now is a great time to give Azure a shoutout for sitting on their hands for 8 years without so much as a response to the community for half a decade [1].

At least AWS allows using a prepaid credit card so they’ll need to call me if things go haywire. I bet if that $72k charge went through it would have been much harder to get out of. “Sorry, we don’t have the money” is a much better negotiating position than “can we please have our money back?”

1. https://feedback.azure.com/forums/170030-signup-and-billing/...

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by dathinab on Thursday December 10, 2020 @07:24PM (#25380716)
But then consider following hypothetical but possible scenario:

Sorry until you pay, no more Amazone services for your company.

Now you must move to a new cloud provider (or make a new company).

Oh, wait they now interchange (bad) customer information to better find fraud and you just got marked at "owning a lot to amazon" so no cloud for you anymore at any provider.

Now you want to buy your own hardware. So you need a credit from the bank, but dang, your owe to much to a big company and the bank now, so no credit for your company either.

While part of above's scenario is luckily not how reality currently works. But then who knows when (part of) such a horror scenario becomes reality.

In the end relaying on forcibly not paying back money you contractually own is just not a very viable strategy in my view.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by betwixthewires on Thursday December 10, 2020 @08:53PM (#25381328)
I see no reason why such an arrangement couldn't be optional. Different projects, teams and people have different needs, cloud computing services are marketed specifically on this point. It makes no sense that there isn't even an option in Firebase or AWS to immediately stop services over a certain amount. The current a situation is ripe for lawsuits IMO.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by dvfjsdhgfv on Thursday December 10, 2020 @10:23AM (#25374629)
> “Sorry, we don’t have the money” is a much better negotiating position than “can we please have our money back?”

I agree but why would you like to be in either position anyway? The so-called cloud services are terribly overpriced when compared to traditional servers.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by treeman79 on Thursday December 10, 2020 @01:37PM (#25376816)
Done correctly they save a lot of IT time.

Seem companies hire five 6 figure people to try and cut amazon bill by a couple of grand a month.

Never understood spending 50-100k a month to maybe save 5k

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by foolmeonce on Thursday December 10, 2020 @06:56PM (#25380466)
>Done correctly they save a lot of IT time

Not really, computing done correctly is about avoiding all of the pitfalls and finding ways to get zero cost benefits, free computation out of necessary redundancy, etc. Selling cloud computing is about creating options around every pitfall and finding ways to charge for every mitigation that will be necessary and charge for redundancy in the mitigation strategy for the mitigation strategy..

Even if you pay for all the redundant managed blah they offer to not lose your business by having any single point of technical failure in their network, their billing and IAM are your single points of failure, if you diversify to multiple clouds all the guarantees either cloud offers is now pointless redundancy so you are paying 10X pricing for an inadequate redundancy layer.

If you look at Google's own model for computing, they didn't fall for this themselves, the computers they used were intentionally unreliable to not recursively pay for reliability and redundancy at any layer that can't provide the needed guarantee.

You can basically go all in with one of these clouds and become a franchise add-on with roughly the same rights as your average mcdonald's store owner, or you are managing a strategy that is far more complex because of the complexity of these offerings than just using metal and free software.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by betwixthewires on Thursday December 10, 2020 @08:57PM (#25381349)
They're very useful if you're testing a concept, need agile scaling of computational power, or are just starting a service and don't want to / can't invest the capital in dedicated hardware. I agree with you on your last point though, making your service entirely dependent on these services makes you little more than a franchise and is a potential vulnerability if you ever compete with any important existing service. It probably isn't a good idea for a mature or rapidly maturing business to rely heavily on these services.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by Retric on Thursday December 10, 2020 @02:34PM (#25377535)
It’s often a fixed vs ongoing cost question. Spending 200k to save 5k per month breaks even in 3.4 years.

However, for growing companies that 5k/month AWS premium can hit 200+k/month very quickly

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by serial_dev on Thursday December 10, 2020 @07:11AM (#25372821)
It is baffling why cloud providers don't have that option.

I might want to have an app because I don't mind spending 50 dollars on my pet project as a hobby, but I don't ever want to spend more than that. Not if I write a wrong query that's suddenly becomes very expensive, not when I got attacked, and not even when I have legit users.

By the way, the same goes for some companies, too, just the threshold would be different.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by greatgib on Thursday December 10, 2020 @07:42AM (#25373071)
It's not complicated to add configurable hard limits for these companies but they don't allow it because the current situation is more interesting for them.

They want to suck the maximum money from consumers before they realize.

For one person that will complain wildly and having to do a gesture, there are hundreds other companies that will not notice or just pay without recourse.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by ctvo on Thursday December 10, 2020 @02:46PM (#25377685)
> They want to suck the maximum money from consumers before they realize.

This is a naive understanding of how corporations like Google and Amazon work. Bad will and using gym membership tactics aren't how they scale or make money. Getting you to confidently try things knowing you won't get charged (the reason they have those free tiers) so you'll get your company, your start-up, your next side project on it is much better for business.

It's a miss that things like this aren't implemented and widespread, not by design.

> It's not complicated to add configurable hard limits for these companies but they don't allow it because the current situation is more interesting for them.

I'm not in this space, but from my observations:

- Each service has a different billing model and metering model. Most likely this data is held by the service. I'm familiar with AWS so I'll use them as an example. I'd wager only DynamoDB or only Lambda (the service owners) know how much of those services you've consumed

- Billing is most likely reconciled asynchronously after collecting all data from all services by an entirely different department with knowledge of payments and accounting

- GCP, AWS, Azure launch 50+ services a year

- Each large customer most likely has a special rate. I bet Samsung or Snap pay an entirely different set of rates than the normal customer. There are thousands of these exceptions

- Cutting your service off when your over the limit is an incredibly complex set of edge conditions. Your long running instance hosting your critical service is shut off because of experimenting on a new ML workflow?

Even with only the above I can see the difficulty in globally limiting your spending limit at an accurate level. I know there are features for both AWS and GCP and they try.

It's easy to stand on the sidelines and handwave away technical complexity at scale, but I'd encourage you to give all of these providers a more charitable view, at least on this topic.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by AntiImperialist on Thursday December 10, 2020 @09:17PM (#25381474)
>Bad will and using gym membership tactics aren't how they scale or make money.

Except they do that with their actions.

>Cutting your service off when your over the limit is an incredibly complex set of edge conditions.

Sure! But if they cared about customers as you claim, they'd let users set hard limits, and when one of these mishaps happened, stop the services when their system eventually knows that the quota has been exceeded... and, make the user only pay the hard limit as the maximum amount. If this continues to happen, warn the user that their account will be terminated... and that's that. But they'll never do that.

Most of their clients pay for these mistakes because they don't have the reach or skills to make this a viral social media article to get people's attention and hence get them to forgive the costs.

I'm sure they know how much they make in revenue because of these mistakes and they deliberately don't do anything about it.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by beoberha on Thursday December 10, 2020 @03:56PM (#25378527)
I work in this space and you’re absolutely correct. Your last paragraph hits the nail on the head for pretty much every complain people have about the public clouds.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by patrec on Thursday December 10, 2020 @05:51PM (#25379878)
Right, so let's say Congress passes a bill that requires cloud providers to enable hard spending limits by start of February 2021, and eat any extra usage costs that exceeded a set limit.

What is your educated guess by when this feature would be essentially correctly implemented in AWS and GCP (essentially = negligible costs to the providers due to either false negatives (bills they eat) and false positives (PR fallout, when SomeSite gets shutdown despite not being over limit)?

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by Paul-ish on Thursday December 10, 2020 @02:07PM (#25377155)
The fact that the dashboards and alerts have a delay sounds like there might be difficult consistency stuff going on. Many nodes need to coordinate their usage and billing. It may be a difficult problem, but solving billing problems might not really motivate anyone at the company. It's not a "cool" problem for engineers and not profitable for product.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by phkahler on Thursday December 10, 2020 @03:10PM (#25377934)
>> The fact that the dashboards and alerts have a delay sounds like there might be difficult consistency stuff going on.

I think that's true. It's easier to measure usage and aggregate that data after the fact than to meter it in real time and stop at a limit. Those are very different things. What happens if you hit the cap while running multiple processes spread across a cloud?

One improvement might be to throttle things as the cap approaches but that doesnt really change the problem at all. Do that and have provider eat any overages should solve it from the user point of view.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by tpetry on Friday December 11, 2020 @01:52AM (#25383127)
Theres an easy solution: You set a limit and everytime a service needs to spend some many it allocates a small portion of the budget and after some threshold it will put unused money back to the budget. The only downside is that your spending limit will be reached to optimisticly, but i prefer that to paying thousands more than i wanted to. Knowing the system works like maybe a lower and higher threshold for the budget could be set.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by abawany on Thursday December 10, 2020 @03:52PM (#25378476)
Every time a GCloud rep would ask us about what we need, we would say: fix the billing interface. As far as I know, it never got fixed. The feelings I would get when looking at cloud billing interfaces can be summed as: obfuscated, like a pawnshop, and caveat emptor. I kind of came to the conclusion that if the cloud giants are not fixing their billing interfaces, then just like Amazon not sending you the details of the items you ordered by email and thus causing you to use the app to help with primenesia, there is a 'business' reason why the billing interfaces are generally incomprehensible.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by onion2k on Thursday December 10, 2020 @09:09AM (#25373824)
They want to suck the maximum money from consumers before they realize.

I have very little money so I just don't use their services because a mistake would be disastrous. They might be losing out on me making a unicorn app on their platform. It's unlikely, but while the possibility of catastrophe exists I'll stick to not using them. That extends to not recommending anyone uses them either in case the worst happens.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by mikestew on Thursday December 10, 2020 @10:41AM (#25374831)
I have very little money...

Then the harsh reality is: companies don't care. Yeah, your app might turn out to be a unicorn, but the overwhelming odds are that it won't. And no one cares that you'll tell your other broke friends to avoid the service.

We'd all like to think it to be different, that a company might care about appeasing my broke ass. But as already pointed out, they want the whales. I also wonder, despite the number of years "cloud services" have been around, if companies aren't still trying to figure out a gazillion other things and limiting customer spend might be a bit low on the priority list.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by thanksforthe42 on Thursday December 10, 2020 @01:33PM (#25376780)
Meanwhile this leaves an opportunity for a different company to provide these services.

I do my best to avoid FAANG giants who don't think about me.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by renewiltord on Thursday December 10, 2020 @02:52PM (#25377743)
The highly price sensitive customer will force you to compete only on price. That's just forcing yourself into a commodity market. It's bad business. I would never try to cater to that market. Very dangerous. Competition will drive margins down to near zero.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by brundolf on Thursday December 10, 2020 @04:01PM (#25378607)
For hobby projects you probably don't need auto-scaling, and should use a provider that charges a fixed monthly rate. You'll "waste" a little bit of money on unused uptime, but for a hobby project it will be a minuscule amount.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by vp8989 on Thursday December 10, 2020 @08:46PM (#25381297)
But then I don't get to be a "serverless hero" and write blog posts about how my side project (that no one uses) costs $0.000034 to run instead of $5.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by uoaei on Thursday December 10, 2020 @03:12PM (#25377962)
> It is baffling why cloud providers don't have that option.

...is it? If a lazy dev leaves their corporate account open and you can bill it for their negligence, protected by the contract you already signed, you earn a lot of money. From a purely business perspective, it is stupid(!) to provide a stopgap for that.

Edit: to be clear I am not advocating one way or the other. But it is surprising that people are "baffled" by this obvious profit optimization.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by camjohnson26 on Thursday December 10, 2020 @06:45PM (#25380368)
Google is around a trillion dollar company, your $75,000 is a completely immaterial amount to them. Not to mention it would be a one time payment that would drive away customers and lead to bad PR like this post.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by AntiImperialist on Thursday December 10, 2020 @09:22PM (#25381506)
Except Google has 4 million customers. If 1% of their customers made a 75k mistake, they make 3 billion dollars.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by uoaei on Thursday December 10, 2020 @11:48PM (#25382428)
So... where else are you going to go if you don't like these policies?

If everyone has this policy, Google, Amazon, Microsoft, and the rest are in a good place. And suddenly it's the "industry standard."

This hypothetical is already enacted today...

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by sandGorgon on Thursday December 10, 2020 @01:32PM (#25376768)
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by ggthrowaway2020 on Thursday December 10, 2020 @04:19PM (#25378858)
As a former victim to the same issue as OP, I am furious every time I see a Googler promote that as a solution.

In our case, we racked up a $10000 bill on BigQuery in ~6 hours, when a job was failing and auto-retrying.

We had set up every alert correctly and our reaction time was about 5 minutes (about $100 of usage, no big deal). So how did we get a $5000 bill? Google's alert was 6 hours late (according to them, this was root-caused to us, because we were submitting jobs continuously). They pointed to their TOS and said they don't guarantee on-time delivery of the alert.

I had to write up a blog post with fancy graphs and prepare it for social media before they finally agreed to eat the bill.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by dathinab on Thursday December 10, 2020 @07:28PM (#25380751)
(By now) GCP documentation says billing alerts can be late by days. Yes days not just hours. Totally crazy.

EDIT:

Link (see blue info box a a bit below the anchor on which the page is opened):

https://cloud.google.com/billing/docs/how-to/notify#cap_disa...

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by donmcronald on Thursday December 10, 2020 @09:14PM (#25381453)
> Recommendation: If you have a hard funds limit, set your maximum budget below your available funds to account for billing delays.

But if 1,000,000% lower doesn't work ($7 vs $70k) then...?

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by sandGorgon on Friday December 11, 2020 @01:18AM (#25382900)
P.S. so im not a googler.

you misunderstand the intent of this - you basically set this. even if it fails (because messages are delayed), google will refund.

This has happened to us before - they do a refund - since you had set the limits correctly. In general, they are not super assholes. I actually dont know a case, where they have refused to refund.

AWS is better here - since GCP doesnt have a support dashboard. So the "chasing them" experience is much worse.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by FeistySkink on Thursday December 10, 2020 @05:36PM (#25379730)
Is there a public postmortem anywhere? Your message points to 'no', but just in case.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by lights0123 on Thursday December 10, 2020 @01:45PM (#25376910)
> There is a delay of up to a few days between incurring costs and receiving budget notifications. Due to usage latency from the time that a resource is used to the time that the activity is billed, you might incur additional costs for usage that hasn't arrived at the time that all services are stopped. Following the steps in this capping example is not a guarantee that you will not spend more than your budget.

This looks like it has the same problems as the post, because it also relies on those budget alerts that can happen a long while after you've exceeded them.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by mgkimsal on Friday December 18, 2020 @01:26PM (#25470201)
Very late to the post, but this seems like "eventually consistent billing". distributed systems seem to rely on "eventual consistency" but... "eventual consistency" is not what most people want in billing threshold scenarios...
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by modeless on Thursday December 10, 2020 @01:50PM (#25376967)
"Following the steps in this capping example is not a guarantee that you will not spend more than your budget."

"Resources [...] might be irretrievably deleted."

Also it's not automatic, you have to manually write code to do it, and test it, and make sure not to break it.

A reasonable implementation of this feature would be built into the console, guarantee a maximum spend, not require writing your own fallible code, and provide an option to preserve storage (at normal cost) so that all your data isn't deleted when your compute/API stuff is shut down.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by asciimike on Thursday December 10, 2020 @02:14PM (#25377237)
Extremely technically, the only GCP product that had this feature was App Engine Standard v1, but looks like it's deprecated as of the end of 2019 (https://cloud.google.com/appengine/docs/managing-costs#chang...)
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by NegativeLatency on Thursday December 10, 2020 @02:35PM (#25377545)
Probably hurt revenue ;)
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by asciimike on Thursday December 10, 2020 @04:15PM (#25378800)
As a former App Engine PM who spent a lot of time with billing/quotas (though, not the one who deprecated this feature), it's likely due to some combination of:

- hard limits caused downtime more often than they prevent these blog posts

- hard limits were inconsistently enforced, even within GAE

- platform wide quota notifications were implemented (reached "GA"), leaving the question of "how a developer wants to handle this" to the developer, not the platform

- maintenance burden

The "I bankrupted my startup by running tests in an infinite loop" blog posts happen ~once a year, while the number of customers (including internal teams!) who inadvertently went down because of this quota was staggering. I feel like I used to see one a week, at least. Most often someone on the team was like "oh I'm going to turn this down to zero because we don't want to spend any money during development", never told anyone, and then they go live and they forgot to turn the knob back up (or didn't properly estimate traffic/costs and set it too low).

I can tell you it hurts revenue a lot more when a large customer goes down for 15 minutes due to quota issues and their usage drops to zero (both in terms of revenue and customer credibility) vs when tiny developer accidentally blows through 10k in a month and we refund it (since, obviously, the providers cost is a lot less than that).

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by Retailer on Thursday December 10, 2020 @08:26PM (#25381195)
Personally, I don't think this is a good enough reason. Worst case, if I experience an unplanned shut down, I will increase my spending limit. Removing the feature entirely because of this just doesn't make sense.

When I also think of the fact that Google tied it to requiring a credit card for almost every single transaction even if it is free gives the impression that it is for financial purposes (aka a way to get more out of developers or those who might be free-loading on the free tier of App Engine)

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by daveidol on Thursday December 10, 2020 @07:59PM (#25380995)
I gotta say that seems like a bad reason to remove the feature. If someone intentionally set a hard spend limit - hit it - and their service went down because of it that's not Google's fault. The simple solution for that customer is to just turn off or increase the limit.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by welkie on Saturday December 12, 2020 @02:07PM (#25400594)
This is a reasonable way of achieving the balance needed. My company would freak out if we had even a short outage that affected all our customers because we set a billing quota too low. And I'd feel a lot more comfortable experimenting with serverless on my own projects if I knew Google would have my back if I made one of those once-in-a-year mistakes.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by mrtksn on Thursday December 10, 2020 @03:23PM (#25378098)
OP claims that the budgets are not real time, they are eventually accurate but if it happens that you spend too fast you may end up with a larger than your budget sum before anything triggers.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by jasonpeacock on Thursday December 10, 2020 @10:50AM (#25374953)
It's surprisingly complex to do that. Let's take a simple example and say your cloud account is doing 2 things - compute & storage.

Compute is an active resource, when you exceed your budget it can be automatically shutdown.

Storage is a passive resource, when you exceed your budget it can be automatically....deleted? That's almost always the wrong action.

Providing fine-grained cost limits help some, as passive resources usually don't have massive cost spikes while active resources do, so you can better "protect" your passive resources by setting more aggressive cost limits on the active resources.

This quickly gets more complicated. Another example is most monitoring services are a combination of active (actual metric monitoring) and passive (metric history) resources. A cost limit on that monitoring service likely won't provide sub-service granularity, mostly depending on whether the service even has different charges for monitoring vs history.

Oh, also, even for a passive resource like storage, you also have active resource charges whenever you upload/download your data.

Ugh, what a mess. The best thing to do is pay attention to your spending, just like you do with your personal & corporate budget.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by AngusH on Thursday December 10, 2020 @01:52PM (#25376998)
But we've had disk quotas before that mostly worked?

If anything it seems an easier problem than processor time.

I recall disk quotas on shared systems at university back in 1998 and I'm sure they existed before that.

Two thresholds IIRC, one at which you get a warning, second at which you can't write any further and the disk write operation fails.

I don't think they deleted files, it was just you couldn't write more than [quota] bytes to your disk.

Is there something particular about cloud based systems that prevent this from working?

ie. is this a specific problem with distributed storage?

edit:tone

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by robrtsql on Thursday December 10, 2020 @02:08PM (#25377172)
S3 costs money to keep your files in, even if you're not touching them, so just preventing further uploads wouldn't do much to prevent your AWS bill from increasing.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by camjohnson26 on Thursday December 10, 2020 @06:49PM (#25380395)
It would let you set an upper limit on the price you pay though. Better than accidentally misconfiguring a logging service and writing gigabytes of unneeded data.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by user5994461 on Saturday December 12, 2020 @02:12PM (#25400642)
>>> But we've had disk quotas before that mostly worked?

AWS has quotas on everything, including quotas on EBS storage per region.

You will realize that after you spin up some instances with disks and it's failing because you've hit 10 TB of EBS storage. Have to raise a ticket to raise the limit.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by Spooky23 on Thursday December 10, 2020 @06:54PM (#25380441)
The IaaS services are easy. Other services are more difficult. Something like BigQuery ML could generate massive bills pretty easily.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by cesarb on Thursday December 10, 2020 @02:51PM (#25377737)
> Storage is a passive resource, when you exceed your budget it can be automatically....deleted? That's almost always the wrong action.

A better option would be to automatically reduce the budget by the amount it would cost to keep the storage forever. If doing that would reduce the budget to zero, do not allow increasing the amount of storage. That is: assume the storage will not be deleted, and budget according to that.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by asciimike on Thursday December 10, 2020 @04:30PM (#25378995)
How does this actually work? It clearly can't be forever, since any non-zero dollar amount * infinity months is infinity dollars, which is going to reduce the budget below zero since any non-infinite number minus infinity is less than zero... thus locking it immediately.

Even if we say "you get N months of storage before we delete it" and subtract N * current storage cost/month, what happens after you're locked out of all actions because you added an extra GB? Storage APIs cost money to use, so you would get locked out of those too (note that if you're not, people would set arbitrarily low limits and get storage access for free) and couldn't retrieve anything. The only remaining actions are delete (which is free) or raise the quota and do the whole rodeo over again.

Abuse is impossible to ignore at public cloud scale, so "free storage forever" (or even, storage at a one time fixed price) as the fallback isn't a viable option.

Lastly, from an optics perspective, which blog post would you rather see on the front page of HN: "I did something dumb and spent too much money on Cloud" or "Google is holding our data hostage" (or "Google deleted all my data")?

Source: I launched Firebase Storage, which has a GCS bucket that has a hard limit.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by cesarb on Friday December 11, 2020 @04:23AM (#25383845)
For it to work, obviously the budget has to be per month (for instance, $100/month), instead of an absolute limit. Most of the time, that's what you'd want: if you calculated that what you use will cost $50 each month, setting a budget of $100 per month would give some room for growth while preventing billing disasters (and you can always increase it a bit if necessary).
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by betwixthewires on Thursday December 10, 2020 @09:08PM (#25381422)
Off the top of my head I'd say that if you're budgeting for storage, the max you can afford for the time period that you'd need to recover data in the event of a budget overrun taking into considerations the delay time for notifications would be a way to calculate that. And that sounds like something that is reasonable to put on the customer to calculate.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by onion2k on Friday December 11, 2020 @12:55AM (#25382778)
You've explained why it's hard for Google to not give me resources I can't pay for, but that's not what I care about, or what I'm asking for. What I'm asking for is a feature where I set a hard limit of $100 and that's the most I get billed - if my account accidently uses $5000 of resources before Google reconciles the usage with my budget then Google automatically waives the additional $4900 and then limits my account in some way until the problem is rectified.

Practically every time these blog posts come up they end with the provider refunding the costs. I just want that refund to be a feature.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by jasonpeacock on Friday December 11, 2020 @11:02AM (#25387213)
So...you're saying that Google should give away $4900 of usage?

How will Google automatically differentiate between an "honest mistake" and someone taking advantage of this feature?

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by onion2k on Friday December 11, 2020 @02:33PM (#25389767)
So...you're saying that Google should give away $4900 of usage?

Yes. But they should also develop mechanisms to warn users that they've made a mistake before it happens, and improve the speed they can detect mistakes to lower the cost, and invent some way to detect someone intentionally abusing the feature.

But mostly they should make the fact they do give away $4900 when a mistake happens explicit. That isn't actually a change. They just need to make it clear that's what happens.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by Closi on Thursday December 10, 2020 @01:35PM (#25376794)
It's almost like you could make it configurable so users can choose what happens if they go over, and to what extent.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by modeless on Thursday December 10, 2020 @03:03PM (#25377864)
It's not really that complex. All compute should shut down. All API calls should fail. Storage should be (optionally) preserved at normal cost.

Your examples are simple given this framework. Uploading/downloading data to storage is an API call. Monitoring is compute. Metric history storage is storage.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by jasonpeacock on Thursday December 10, 2020 @04:17PM (#25378833)
But storage costs continue to add up even when you're not accessing them - there's a cost to storage existing which continues to accrue with time.

When there's no budget left, what do you do with those accruing costs for existing storage?

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by modeless on Thursday December 10, 2020 @04:55PM (#25379277)
Storage costs are predictable and slow to accumulate. They are rarely the problem people are trying to address when they set a budget. As I said, storage would optionally continue to be charged at the normal rate, the other option being immediate deletion if you really need a super hard budget cap.

Once you get the alert that your budget is tripped you can go and see what's in storage via the console and delete it, only paying for a few hours of storage for things you don't want.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by AngusH on Thursday December 10, 2020 @04:38PM (#25379080)
If the amount of storage that you can use is limited by quota (say 50GB) the problem becomes relatively easier.

You set a quota for 50GB of storage and no more. The server then restricts you by disk quota to that amount of storage.

The cost is then calculated as 1.15USD per month.

So you don't pay more than 1.15 per month.

Compute and transfer (and other things) could be covered by separate similar quotas with a single maximum spend figure at the bottom of the table.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by asciimike on Thursday December 10, 2020 @04:37PM (#25379066)
Moreover, once API calls are locked, what next? You can't delete files, and even if you can delete them, you aren't able to retrieve them before deletion... If a platform allows you to do those actions, then it's rife for abuse, and at public cloud scale that ends up being a far, far bigger problem than the occasional blog post that ends up as a refund (because the other blog post is "I got free storage forever with this one weird trick").

It's really not a simple problem because the next action depends on the choice the developer wants to make: do they increase the budget or decrease usage, and no cloud provider wants to make this choice because no matter what the choice is it will be viewed as wrong. The best they can do is provide developers the best insight and tooling to make this choice themselves.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by modeless on Thursday December 10, 2020 @05:03PM (#25379376)
Once API calls are locked you can open the console, disable all the things that caused you to hit your budget, and then raise the budget a bit to get access to the storage APIs again and manage your storage. Or, the console's storage browser should let you browse and delete files as well. And again, there should be an option to delete all storage immediately for a hard cap on your budget if you really want that.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by AngusH on Thursday December 10, 2020 @04:43PM (#25379128)
You need separate costed quotas for each type of activity with a combined total at the bottom.

You could also have a setting in the admin panel as to what the system should do:

[ ] I want to keep going beyond my quotas (but email me)

[ ] Please shutdown my site

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by asciimike on Thursday December 10, 2020 @05:03PM (#25379372)
If the answer is "you have a dollar limit set of GCS GETs, GCS PUTs, etc." I guess I could see this working, but hot damn that'll be a horrific interface.

The other issue is that many large customers pay different prices, so billing and quota aren't really tied to each other, and it wouldn't be easy to reconcile this.

As for the button... having been on the product side of building this button, there is no right answer: people will say they never got the email (or it went to the wrong inbox, or their dog ate their phone...) or that they never checked the box to "shut down the site" ("I didn't think it would do X that made my app not work").

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by AngusH on Thursday December 10, 2020 @05:26PM (#25379643)
I'd probably want it grouped by category with a drill down interface for the specifics.

Probably arranged so you can type in a figure at the bottom for monthly expenditure and it would balance out the requirements based on typical use cases.

So enter $50 in the monthly cap figure and it allocates, say, $20 to compute, $20 to transfer operations and API calls, $10 to storage

which you could then fiddle with of course.

I can't offer much on the second point other than to say that unexpected bills annoy me much more than services that stop working.

I've also never worked anywhere with unlimited budgets. (alas)

I can see that there are probably cases where uptime is more important so they would be more annoyed the other way around.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by jsiepkes on Thursday December 10, 2020 @07:10AM (#25372815)
Not only development but also running in production. You can configure alerts but you can't configure a hard limit. Thats just insane. That makes working with GCP like playing with fire.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by k__ on Thursday December 10, 2020 @07:19AM (#25372875)
What about throttling?
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by herendin2 on Thursday December 10, 2020 @07:24AM (#25372918)
Nice to have, but people want a throttle that shuts off dead at a certain number of dollars
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by pwinnski on Thursday December 10, 2020 @09:33AM (#25374048)
aka "Bankrupt me more slowly"

Throttling doesn't stop the drain.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by ZephyrBlu on Thursday December 10, 2020 @07:29AM (#25372951)
Probably because it's not so simple on the backend.

I'm guessing there's a good chance a lot of systems are only eventually consistent, which could explain why billing takes a long time to update.

Aggregation of service usage for billing could also be an expensive operation, so it's only updated irregularly instead of being near real-time.

It would be a great feature, but I can imagine it being very complex. It's also probably cheaper for them to just wave away excess usage like this instead of building out a solution.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by a-priori on Thursday December 10, 2020 @02:50PM (#25377717)
This is a billing question, not a technical question, and looked at through that lens it's easy to put a hard limit on a monthly bill: just don't ever issue bills greater than that amount.

If I say I only want to pay a maximum of $1000 a month, and I hit that limit but it takes a bit for the provider to shut everything down so really $1100 of resources were consumed, then the provider eats the $100 overrun and I get a bill for $1000.

With an actual hard limit you create a financial incentive for the provider to minimize this overrun. Yes it might be difficult to fix but I assure you, if hard limits existed, the technical issues would be solved soon enough because now there's a reason to invest in a solution.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by benlivengood on Thursday December 10, 2020 @03:00PM (#25377824)
It's also a mostly solved problem because advertisers have budgets and it's common to implement globally distributed budget servers to avoid showing more ads than the advertiser paid for, despite tens of thousands of individual web servers needing to know which ads in their inventory have budget left.

It's a fun exercise similar to global rate-limiting/load-balancing.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by wikibob on Thursday December 10, 2020 @04:25PM (#25378923)
That is fascinating.

If you have the time could you (anyone feel free) talk a bit about how you would implement a globally distributed budget?

I can imagine a few simple options, but they all seem to have significant shortcomings.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by benlivengood on Thursday December 10, 2020 @07:00PM (#25380515)
I think the simplest is a tree of servers (which can be sharded by user if necessary for load balancing). The root has the total budget and offers short-term small leases of ad views to child nodes, who may also have child nodes doing the same thing with even smaller leases.

Web servers check with the leaf nodes for every ad they want to show. If that leaf has a budget greater than zero it decrements its own budget and returns success. If the web server gets a success it shows the ad, if not it checks with another budget server or two. Web servers frequently log how many ads were served per client.

Whenever leases are up the intermediate nodes inform the parents of how much was spent and get a new lease. If nodes crash or otherwise don't return their lease then their parents have to assume the whole budget was spent, but leases are kept small to avoid big discrepancies.

If the root crashes then there are problems so the root can be a slow ACID replicated database as long as its immediate children are mostly reliable and take large enough leases to minimize load on the root.

Periodically web server logs are aggregated to adjust the root budgets to account for crashed intermediate nodes and web servers.

The tree approach allows global low latency operation guaranteeing no overspending and minimizing underserving. Nodes are provisioned from the leaves on up to handle the necessary amount of traffic and to ask for leases large enough for 99.X% percent of child requests to succeed.

Any cloud provider could use the same technology on individual hosts to grab leases of CPU, RAM, disk, etc. by the minute per user and terminate services with no budget. Leases could be a lot longer because most budgets are monthly to cover all service needs and not pathological ad campaigns with low budget, high bid, and huge audience.

It's up to cloud (or ad server) providers to decide whether to stop services if the budget system is broken. In most cases it makes sense to fail open and keep serving and eat the loss because shutting everything down will incur even bigger losses.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by kevsim on Thursday December 10, 2020 @08:53AM (#25373679)
I think that's not really an issue though is it? If you say "never charge me more than $100" they can a) ensure they never charge you more than $100 and b) work to optimize their own systems so that they cut you off as close to $100 as humanly possible. In the beginning they might eat some costs since it takes them a day to catch it, but they could work over time to bring that down. And it's not like it's costing GCP/AWS/Azure "sticker price" to provide their services.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by donmcronald on Thursday December 10, 2020 @07:36AM (#25373023)
Azure has it for some plans [1], but not others like pay-as-you-go. It seems arbitrary.

1. https://azure.microsoft.com/en-us/support/legal/offer-detail...

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by raphaelj on Thursday December 10, 2020 @03:14PM (#25377979)
It's ever worse for services like AWS Cloudfront.

One of your competitors could just rent a cheap server on OVH with uncapped transfer and incur you $10k in cost in a few hours.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by cambalache on Thursday December 10, 2020 @04:13PM (#25378779)
Maybe that it is your cue to move your server from AWS to OVH*

* I dont have any idea about OVH

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by tcoff91 on Thursday December 10, 2020 @06:47PM (#25380380)
CloudFront is a CDN. What the poster you've replied to is talking about is a competitor setting up a server that repeatedly downloads your content to rack up a huge CDN bill. OVH is not a suitable replacement for a CDN so you can't migrate from Cloudfront to an OVH server because a server is not a viable replacement for a CDN.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by jyu on Thursday December 10, 2020 @07:00PM (#25380516)
There is an easy explanation: It's hard to build this feature, there is no pressing demand from upper management, it's easier to get promoted doing other simpler projects. Think about what a real time snapshot means: you need to know how much of all the services are being used, project that in the future and compute the costs.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by betwixthewires on Thursday December 10, 2020 @09:14PM (#25381451)
Really, it is a bit disappointing to see a bunch of engineers in this thread talking like this is some monumental, borderline unsolveavle problem. The solution is pretty easy to figure out, even taking into consideration different needs of different customers. The implementation might not be trivial, and legal liability questions might have to be considered beforehand, but the problem is not that hard.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by cambalache on Thursday December 10, 2020 @04:10PM (#25378730)
That should be illegal, but hey, at least they support noble causes, so let them be. It sounds cynic but this is their game.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by betwixthewires on Thursday December 10, 2020 @09:17PM (#25381471)
To me this is akin to the personal checking overdraft scams banks were running for many years until those practices were made illegal.

There is no engineering hurdle that is a valid excuse for allowing a customer to go over their stated budget by 86 million percent.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by trymas on Thursday December 10, 2020 @02:48PM (#25377697)
AFAIK digitalocean has notification if you go over user defined limit.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by rk06 on Friday December 11, 2020 @12:40AM (#25382704)
FWIW, Azure has that option
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by nojito on Thursday December 10, 2020 @07:40AM (#25373060)
Price transparency is the antithesis to the "cloud" and it's current financial success.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by bpodgursky on Thursday December 10, 2020 @01:32PM (#25376772)
There are some cloud services where it's not quite this simple.

S3 -- you can't just delete customer data because they hit a billing limit

RDS -- not going to drop databases on the 27th of the month

Anything with persistent data is going to have to stay alive and accumulate costs. Admittedly these services aren't where the crazy bills come from, but it does make a simple kill switch a bit more complex.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by raphaelj on Thursday December 10, 2020 @02:58PM (#25377799)
You don't have to immediately delete customer data.

Most service that has a limit cap will have a "grace period" of a couple of days during which the service does not work but the data is not deleted. That give your some time to get notified of the issue, and fix the problem/increase the limit.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by heavyset_go on Thursday December 10, 2020 @03:49PM (#25378427)
This is a solved problem for every other service out there. You don't just delete the data, you give the customer a few days, weeks, or a month to pay their bill and if they don't, then you delete their data.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by betwixthewires on Thursday December 10, 2020 @09:25PM (#25381533)
The problem with this though is it opens a vector for exploitation: users could just use the grace period to store data for free for a period of time. This can quickly become a heavy financial burden if enough people do it.

You could factor that into the price, but then you're potentially making the price point even more unattractive to users than it already is, and users that are responsible with their budgets would be subsidizing those that aren't. Not a very workable solution.

I'd say a good solution is giving customers the option to stop accruing more storage capacity, and to have a max deadline accounted for in their budget to store data (basically each customer decides whether or not to pay for a grace period).

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by heavyset_go on Friday December 11, 2020 @02:03PM (#25389357)
I've accidentally let my OVH subscription go unpaid, and they gave a 7 day window to pay my invoice or delete my data. That's seems pretty fair to me, and they seem to have wide enough margins to eat the cost and still offer some of the cheapest prices out there right now.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by gonzo41 on Thursday December 10, 2020 @07:26AM (#25372932)
I wouldn't be too scared. For AWS you get about $0.20 per 1 million requests on Lambda. You can do quite a lot with a single Lambda function. And a million of anything is a lot for a dev. Put a HTTP API Gateway infront of that with a CDN and you're hitting ~ a few dollars.

If you don't buy one coffee, or put a 20 dollar note in a book one month. Then you're fine. And if you have to use EC2, just use a t2.micro or a raspberry pi on your desk.

But really the first lesson you should learn in any cloud setup is Billing Alarms :)

If you're doing ML or CV work then it's probably cheaper to build on the desktop and port to cloud once you understand what the workloads are.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by onion2k on Thursday December 10, 2020 @07:35AM (#25373006)
For AWS you get about $0.20 per 1 million requests on Lambda.

If you get it right, great. If you get it wrong then you end up doing billions of operations by mistake, which could cost a huge amount. That's what happened to the author of the article.

But really the first lesson you should learn in any cloud setup is Billing Alarms

Alarms only tell you that something is going wrong. They don't stop it. If your mistake is costing $1000/minute and you're an hour away from a computer you have a very expensive problem.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by gonzo41 on Thursday December 10, 2020 @07:43AM (#25373077)
You can trigger events from alarms. And Lambda's only last 15 minutes. So still cheaper than 75K :D.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by welkie on Saturday December 12, 2020 @02:16PM (#25400677)
That's not a bad idea. You could set it up to delete all Lambdas (assuming you've got a CI/CD system capable of redeploying them quickly later) if the billing goes over. Of course, this may hurt you more because of the outage it would cause. Up to you really.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by jjk166 on Thursday December 10, 2020 @09:09AM (#25373821)
So you're taking code that you haven't validated locally to see what resources it uses, you're putting this up on the cloud to test it, then you are immediately going to the middle of nowhere without your laptop/phone/etc, and you can't arrange for a coworker or friend to pull the plug for you if something goes wrong?
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by patrickaljord on Thursday December 10, 2020 @02:41PM (#25377616)
> and you can't arrange for a coworker or friend to pull the plug for you if something goes wrong?

This is HN, many of us are solo founders with no coworkers or employees. Also how could a "friend" pull the plug? If it was a physical server running in your house maybe, otherwise you can't really give them access to your AWS account with all your private clients data in there.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by jjk166 on Thursday December 10, 2020 @02:54PM (#25377765)
If you don't have anybody who can monitor your test, and you're not monitoring your test, why are you doing a test?

As for having a non-employee pull the plug, set up an IAM user with permission to access the test instance

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by WrtCdEvrydy on Thursday December 10, 2020 @03:51PM (#25378459)
> you're not monitoring your test, why are you doing a test?

Agile. Bringing you bankruptcy at the speed of cloud.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by jschwartzi on Thursday December 10, 2020 @03:07PM (#25377908)
If I'm the only developer on a project and I really need to get to market I might do just that. I sometimes do day hikes on weeknights so this is actually a likely scenario for me.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by jjk166 on Thursday December 10, 2020 @04:40PM (#25379095)
Do you go hiking alone without your phone? That seems dangerous.

And why would you start a test if you won't be there to see the results of the test? Seems more sensible to either leave after you've run the test or wait to do so until you get back.

Re:Burnt $72k testing Firebase and Cloud Run and almost went... by jschwartzi on Friday December 11, 2020 @02:50PM (#25390045)
If a test is going to take more than an hour then I'm not going to sit around after work waiting for it to finish.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by jschwartzi on Friday December 11, 2020 @11:28AM (#25387505)
Yeah pretty frequently. It's not dangerous at all. Maybe if I was climbing alone it would be.
Re:Burnt $72k testing Firebase and Cloud Run and almost went... by gonzo41 on Thursday December 10, 2020 @07:40AM (#25373057)
Just to expand on this. You can have a hard limit. For AWS, create a role/user that's essentially ~root like access. Make a lambda function that's triggered by a billing alert at your threshold to just turn off things from most expensive to least. So turn of the DB servers. So the apps error out and the users go away.