I love serverless. Less time managing a server, more time coding my project. But the problem is there is a bad trend within the industry when it comes to setting budgets.
Due to the unlimited scalability of serverless and cloud computing in general, there are loads of hidden fees. You could wake up with a surprise $100,000 bill, for example.
Here's a $100,000 bill a Netlify user was billed after joining the Netlify Starter ($0) tier:
So I received an email from Netlify last weekend saying that I have a $104,500.00 bill overdue.
If you went over your initial free 100 GB bandwidth, Netlify would charge you $55 for every 100 GB after. This hidden fee surprised people who thought the free tier was...free.
Fortunately, it looks like Netlify has updated their policy:
If your app or site exceeds the Free plan limits for the month, it will be suspended for the remaining days in the calendar month. At any time you can reactivate your site in seconds by upgrading to a usage-based plan.
This is a lot better than charging users! Unfortunately, this behavior is far from the industry standard. Take this surprise $100,000 Firebase bill that happened this month. Believe it or not, Firebase says:
Setting a budget does not automatically cap Google Cloud or Google Maps Platform usage or spending.
Setting a budget merely alerts you. If you want to implement a kill switch, you'll have to figure it out on your own.
The reason most serverless providers don't provide a spending cap is obvious: they want more money. And that's understandable—I want more money too. The problem is when you get this money through unethical means.
But what really disappoints me is that these cloud providers are likely already making more than enough revenue by overcharging for bandwidth.
Serverless providers charge you too much. For example, let's take compare Hetzner (VPS) and Netlify (serverless).
Hetzner, a VPS provider, charges €1.00 ($1.13) per TB. Netlify charges $550.
Obviously, this is not a 100% fair comparison. Price per TB of bandwidth can vary a lot, especially by region. For example, a VPS in the US costs a lot more than a VPS in Europe. And Netlify has the edge, for example, among many other services.
But a 4867x increase is still insane even knowing this. Especially since Netlify is (probably) an AWS wrapper. Needless to say, they likely make a lot.
So I see now how serverless providers can afford to run free plans...and forgive debts.
If you use a serverless provider that has uncapped billing, you have three options:
- Switch to one of the rare providers that have capped billing
- Implement a kill switch
- Self host
Option 1 is good, but sort of side-steps the problem. Option 2 sounds good, but not only is it difficult to set up, but there could be a delay between your bill exploding and the kill switch finally activating.
Option 3 seems to be the play. Software like Coolify makes it easier than ever to self host. While it's not free, you'll probably save money if you're using any serverless paid tier.
I've read (but cannot track down the original sources for the life of me) stories of people who switched from the cloud to a VPS and went from spending thousands of dollars a month to double or low triple digits. That's a win!