by arcticfox · 10y ago · 0 comments
One of my services had a Google BigQuery "budget" set at $100. One of our test machines went haywire and continuously submitted a bunch of jobs. The "budget" turned out only to be an alarm, and even that they sent us 8 hours late, after $1600 of charges had been racked up. I responded in 20 minutes and shut it down. Google insisted we pay the full bill. After I wrote up a blog post on the situation and had the "publish" button warmed up, they finally relented and refunded us for the amount of time their alarm was delayed. Absolutely ridiculous that's not their policy to begin with...
For a company that supposedly puts the customer first, this is appalling.
There are a number of resource types that, simply by existing, will accrue costs. A lot of them, actually. On AWS that includes things like running EC2 instances, EBS volumes, RDS databases and backups, DynamoDB tables, data in S3 buckets, and more. The question is what should happen to these resources upon hitting a billing ceiling?
Should EC2 instances be terminated (which deletes all data on them), DynamoDB tables deleted, S3 data erased, RDS databases deleted? If that was the behavior, it would be an extremely dangerous feature to enable, and could lead to catastrophically bad customer experiences. This is a nonstarter for any serious user.
Conversely, if you expect those resources to continue to exist and continue operating, then that's basically expecting the cloud provider to pay your bill. The provider will then have to recoup those costs from other customers somehow, and so this option sets poor incentives and isn't fair to others. If you expect your account to remain open the following month, you'd have to settle the bill, and we're back to square one.
AWS gives people tools to tackle this problem, such as billing alerts. These can notify you over SMS, email, or programmatically when you hit an "$X this month" billing threshold, and then you can decide what to do. Since these events can be processed programmatically, it's possible to build a system that will automatically take whatever action you'd like AWS to take, such as shutting things down or deleting resources.
If you think all of this through, it's really hard to come up with an approach to billing limits that's fair and a good experience, so I think it's reasonable for cloud providers to give billing threshold alerts while leaving the choice of what to do in the hands of the customer.
Let's take a simplistic example and say you're paying per gigabyte. You decide you're willing to pay up to $X, and Amazon tells you ahead of time how much your $X will buy you, and you accept.
One type of customer will be using that storage to store priceless customer photos. Even if the customer ends up deleting the photos, it has to be your customer who makes that decision - not you, and not Amazon. You tell Amazon that you'd like an alarm at $X-$Y, but that if you hit $X, keep going, at least until you hit $X+$Z.
Another type of customer will be using it to store a cache copy (for quicker retrieval) of data backed up in a data warehouse somewhere. You tell Amazon that you'd like a policy which automatically deletes all the oldest data, to guarantee to stay under the limit.
Yet another type of customer would rather keep their old data and just return an error code to the user for stuffing too much new data into too little storage, so basically, guarantee to stay under the limit, and guarantee never to delete data.
You can't solve billing until you communicate with your customers and ask what they want.
So lets for a moment assume you talked to a large cohort of customers, and found a bunch of "types" including those three you list and many many more (inevitably, at AWS's scale).
You then need to make some business decisions about which of those "types" are most important to you, and which are way less profitable to spend time addressing.
So of course you solve the big pain points for your customers spending tens or hundreds of thousands of dollars per month before you prioritise the customers worried abou going over a tens or hundreds of dollars a month budget.
What would that solution look like? It'd have ways for customers with hundreds or thousands of services (virtual servers, databases, storage, etc) to make all their own decisions about alarms, alerts, cost ceilings - and tools to let them decide how to respond to costs, how to manage their data availability, how to manage capacity, when to shut down services or limit scaling, what can and cannot be deleted from storage. It would also 100% need to allow for practically unbounded capacity/costs for customers who need that (Think AliExpress on their "Single's Day" event where they processed $1 billion in sales in 5 minutes.) All this would need - for the $100k+/month customers - to be machine drivable and automateable, with extensive monitoring and reliable alerting mechanisms - and the ability to build as much reliability and availability into the alerting/reporting/monitoring system and the automated provisioning and deprovisioning systems as each customer needs.
And at least to a first approximation - we've just invented 70% of the AWS ecosystem.
You might think Amazon don't cater to people who want hard $5 or $70 per month upper limits on their spending. You're _mostly_ right. There are many other people playing in that space, and it's _clearly_ not a high priority for Amazon to complete for the pennies a month available in the race-to-the-bottom webhosting that people like GoDaddy sell for $12/year.
The thing to think about is - "who does Amazon consider to be 'their customers'?". I think you'll find for the accounts spending 7 figures a year with AWS - billing _is_ "solved". The rest of us are on the loss-leader path (quite literally for the "free tier" accounts) - because Amazon only need to turn a few tenths or hundredths of a percent of "little accounts" into "their customers" for it all to work out as spectacularly profitably as it is doing right now.
When a customer's ceiling is reached, their mix of services goes into limp mode. Things slow down, degrade, maybe become unavailable, depending on each service's "freeze model". Alarms ring. SMS messages are sent to emergency phone numbers. The customer is given a description of the problem and an opportunity to solve it -- raise the cap or cut services.
So wouldn't this cost Amazon money? Sure, but that's a cost of doing business. And as others in the thread have pointed out, the actual costs to Amazon are surely much lower than the "loss" they're incurring by not unquestioningly billing the customer. Especially since Amazon often refunds large surprise bills anyway.
If this were the official policy -- no dickering required -- there's a definite cohort of risk- and uncertainty-averse customers who would be willing to start using Amazon (or switch back).
That's what stopping instances _is_ already. You don't get charged for stopped instances which is a defining feature of Amazon's cloud. Very few providers actually offer this. Most just charge away for the compute even if the instances are powered off, Azure being one exception.
This whole "spin up compute and get charged a minimal amount when not in usage, but keep your working environment" model was pioneered by Amazon.
> So wouldn't this cost Amazon money? Sure, but that's a cost of doing business.
Why would Amazon spend a bunch of money, so that they can charge customers _less_ money, in order to keep customers who are cheapskates, and/or won't take the time to learn the platform properly?
But, they don't don't give us the choice. I need to keep an eye every moment of every day for an alarm, as hundreds or thousands of dollars rack up. That's the ONE THING I DON'T WANT. I'd take anything else (delete my data, lock everything, whatever) over charging me money I can't afford to pay.
I think it would be reasonable to put everything into a no access / deep freeze mode, until I pay up and choose to unfreeze. Would it cost Amazon that much to just keep my data locked for a couple of weeks while I sort out my storage? I'd even be happy for a reserved $100 or so to pay for keeping the storage going.
You know you can make a machine do that for you - right?
In fact all the tools Amazon would use to do this are available to you right now. Cloudwatch, SNS, and Lambda are 98% likely to be all you need - apart from the time to get it set up to do whatever you think is "the right thing".
No one running a real business on AWS wants a hard ceiling instead of billing alerts and service by service throttling. Which Amazon has.
So, this is just the nuclear option for people's pet projects. It's not a bad thing to have but I wouldn't expect it to operate any differently than what would happen if you broke the TOS and they suspended your account.
That's absurd. Of course there are businesses that want hard ceilings. Perhaps not on their production website[1], but on clusters handed over to engineers and whatnot for projects, experimentation, etc.? I've seen these things lay around for months before they were noticed.
[1] Maybe you don't consider startups 'real' enough, but I can totally imagine early stage startups wanting limits on their prod website, too. You can't save CPU cycles for later consumption.
Are you sure? I'd imagine many startups would rather take a few hours of downtime over billed thousands erroneously. The latter could easily mean the end of the company but the former, when you are just striking out is not the end of the world by far.
I know startups that I could bankrupt with a few lines of code and a ~$60 server somewhere long before they'd be able to react to a billing alert if it wasn't for AWS being reasonably good about forgiving unexpected costs.
I'm not so sure no one running a "real business" would like a harder ceiling to avoid being at the mercy of how charitable AWS feels in those kinds of situations, or when a developer messes up a loop condition, or similar.
Perhaps not a 100% "stop everything costing money" option that'd involve deleting everything, but yes, some risks are existential enough that you want someone to figuratively pull the power plug out of your server on a seconds notice if you have the option.
You know exactly how much a paused EC2 instance charges you. The ceiling implementation could say, if the total amount charged so far this month, plus the cost of pausing the instance for the rest of the month, exceeds the ceiling, pause it now. So there's no data loss; the worst case is the customer's service is offline for the remainder of the month (or until they approve adding more money). At some point less than this number, start sending angry alerts. But you still have a hard cap that doesn't lose data.
It's not what a serious production user wants, but it's exactly what someone experimenting with AWS wants, either a running service that's looking at a cloud migration, or a new project/startup that hasn't launched yet.
Granted, for a big company, that amount may be so big it's unrealistic to ever hit it.
Most companies will hold onto your data for a time, then delete it afterwards.
This doesn't smell like technical concerns to me. It smells like sneaky Amazon-wants-to-make-more-money concerns.
(<snarky> What's a gallon of milk on the shelf really cost Walmart? And how much of it is opportunity cost? If I usually buy 2 gallons a week - why can't I keep taking home a gallon every few days for a month or so after I stop paying, then cut me off afterwards? Sounds like a sneaky Walmart-wants-to-make-more-money concern.)
On the other hand, based on near-universal industry practice, there doesn't seem to be a huge demand for this. I suspect it may be better for everyone concerned to have heavy-duty users control their costs in various ways and for Amazon to refund money when things go haywire without bringing someone's service down.
I've seen engineering teams hand out accounts to support teams for testing, and since the resources are not under the purview of the dev team things go unnoticed until someone gets the bill. Arguably there are better ways to handle these requirements, but it'd be nice if you could force people down the path of setting billing alerts because these individuals don't always realize that they are spending money.
So maybe a couple of EC2 instances go down, but you pay for and keep S3, Dynamo, etc. At least enough to salvage or implement a contingency. You'd still owe Amazon the money.
It's tempting to wonder why Amazon would incur that risk, but it is a risk already inherent to their post-pay model, and it serves as good faith mitigation to the runaway cost risk that is currently borne by the customer.
Not perfect, but maybe a compromise.
Not saying Jevon's Paradox wouldn't kick in, but the friction of convincing businesses to work on tools to allow their customers to spend _less_ money is high.
My hypothesis is that they don't really have it nailed down but given big margins they have they can afford to let you use more resources than you pay for in the end.
One time we had literally 1 million cloudwatch metrics get created because we were monitoring mongodb databases and a CPAN test was creating test DBs and not deleting them and we were not ignoring dbs created with names like test_* when creating the metrics.
Another time an outside developer committed a root credential on a public repo in github to a (basically) unused amazon account.
Both times they refunded the costs. Not sure if that was because we were paying tens of thousands a month though to get this service though!
[0] https://cloud.google.com/appengine/pricing#spending_limit
> Important: Spending limits are not supported in the App Engine flexible environment
> You may still be charged for usage of other Google Cloud Platform resources beyond the spending limit.
Can it incur charges even if you've set up the server to only be a free tier?
Yes, you can incur charges if you exceed what's covered by the free tier. Not all AWS services even have a free tier, and those that do are severely limited (1 micro instance, 5GB of S3 storage, etc). You're not off in some sandboxed environment where they just shut you down if you go over the limits. It's more like a monthly credit of $X for the first 12 months of your account. To cover my ass, I set a really low billing alert threshold. Like "email me if my monthly bill ever projects to exceed $1".
It is worth trying if just to gain knowledge on AWS. But for hosting, I'd say DigitalOcean
https://aws.amazon.com/ebs/pricing/ https://aws.amazon.com/ebs/previous-generation/
I had a personal $400 learning experience with Amazon. They did refund it. My last company had a low-5-figure surprise a few years ago. Some of that could be considered their fault (alerts were sent to someone on vacation), but again, the refusal to allow the option of a "hit a limit, pull the plug" option is what causes this.
Personally this is the main reason why I have never considered using AWS for my small projects, but maybe this is an intentional choice by Amazon, to keep away "hobbyists" and only go after companies where an extra $1k in AWS bills this month is just a blip on the radar...
They have billing alerts ('beta') and used to offer a prepaid account type that they have discontinued for new customers (some may still have grandfathered accounts).
Closest thing now is the MSDN credit. It doesn't require a credit card and the account auto-suspends when you hit it. Problem with the MSDN credit is that it is for non-production only (and they reserve the right to kill anything they consider "production").
They should really offer prepaid again or bill caps. But Microsoft is too busy copying AWS to consider that they can do better than AWS.
It's not unlimited liability, most of their services have limits imposed. If you've scaled any service to thousands of machines you'll quickly find out that they stop you at 20-30 machines or so. Then you have to contact support to get the limit increased.
Sure you can still rake up an unpleasant bill. But there are limits :)
And I've done work for clients that have requested really big increases because of both realistic and unrealistic expectations of handling traffic peaks. E.g. one client asked for an increase to 100 instances of 2-3 different types in a few regions to be prepared to handle a couple of days of high traffic. If said event had happened, they scaled it all up, and somehow didn't take them down again, it'd only take a few days of charges for them to be insolvent at their then-current funding level.
So you're right, there are limits, but limits or not doesn't matter if it's high enough that it can make you go out of business.
Which makes me wonder if anyone has ever gone out of business because AWS was unwilling to forgive a "surprise" bill. I'd be inclined to assume that they're willing to stretch quite far to avoid that, given that they seem to be very good about it. But I'd also not want to stake my business on hoping Amazon will be charitable about something like that.
I agree with your larger point, but you're going to be surprised by a $500 bill, not a $500,000 bill.
Did you set a billing alert? Google BigQuery has proactive "cost controls" that won't let you go overboard, whereas billing alerts are just that - alerts.
They offer billing alerts, have a budget tracker thingy, but have no actual automated caps. Closest thing you can do is write one yourself using the AWS APIs.