Be careful what you test or deploy to Vercel
twitter.com
twitter.com
We've concluded our analysis.
1. We're refunding the overages
2. We identified the root cause
The root cause is that the Astro bundle handed to the deployment process is monolithic. There was a top-level `await` for an RSS endpoint which called an API with `fetch`. The issue is that these two (and the rest of the app) were bundled together!
Therefore, any time the function was invoked, that top-level `await` was running for all endpoints. It never yielded. And it's fully autonomous, which means it'd keep running regardless of even a browser being open once the chain reaction started.
This is a Swiss Cheese[2] kind of failure. It required the top level await, the monolithic bundle, and the RSS function using `fetch` (i.e.: over the network) rather than `import`-ing the data layer API directly.
Most importantly, what we're doing: we are going to deploy a fix to ensure this doesn't happen again, across frameworks. I really appreciate Mike raising this and hopping on a zoom call with me while our team investigated.
As an addendum for HN: we're continuing to refine the tools and patterns to best "harness" the practically-infinite ability for Serverless and Edge functions to scale horizontally. It's an awesome property, but it's taught us valuable lessons. We've come a long way in adding guardrails and alerts, and this will be another value-added protection that future customers will enjoy.
1. My issue is not real
2. Okay, your issue is real, but because I'm not paying $$$ we're going to ignore you
3. I should do free work for Vercel and poll their community forums to see how widespread the issue is
4. Their support is only trained to handle frontend issues and because this is an issue with their CDN it's expected that they'll respond incompetently
5. They'll escalate with their CDN team and respond in one week (that was over a month ago, no follow up whatsoever)
It's hard to take Vercel seriously. As a toy, it's probably fine. But I'll ultimately move this project off of their CDN product as soon as it reaches costly volume.
You guys are always on top of things community wise, especially Lee Robinson in any related thread :')
If OP didn't had any followers or else, Vercel would probably had done nothing.
There's a ton of places to get cloud credits as well, too many to link, so just Bing™ it
[0] https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_...
[1] https://aws.amazon.com/apprunner/
I work with a small crew and having no server maintenance lets us ship more code. Really as simple as that.
It was announced that App Runner (today) allowed for smaller instances[2], and the price/mo for this instance would basically be 1/4th of the previous default. So ~$14 [3]
[0] https://aws.amazon.com/lightsail/pricing/
[1] https://calculator.aws/#/estimate?id=42b33d2f26786ac08a3610a...
[2] https://twitter.com/danilop/status/1643968804727271425?s=20
[3] https://calculator.aws/#/estimate?id=a46d5f15ed9c079131c6a73...
Maybe for some hobby projects but not for stuff that needs to stay up, and lets me focus on solving customer problems.
Large, valuable customers wouldn't use this option. It would only help the hobbyist types who aren't doing anything mission-critical and aren't the platform's most profitable (not big spenders, not particularly loyal because they aren't big enough to tailor their infra to that platform, etc.)
And when we talk about the in-between - startups - I'm pretty sure I read at least one anecdote on here about being put out of business by surprise hosting bills
Unless they prefer to rely on being large and valuable as a leverage, they just have much bigger limits. And even in such autoscale-type company there may be a separate department that would want to limit their budget because they have one. Imagine spending $100k extra accidentally in your office while the whole budget is around $10M and now you can’t simply reach support on terms of “that billion was clearly a mistake”, because $10.1M seems normal.
If this happened to me, and Vercel refused to refund it, I would simply cancel the service and dare them to collect the debt.
I don't see how?
if (cap != null && service.currentBill > cap) {
service.deactivate()
}And for storage or storage-having services you could easily have a "shut it down but preserve the data for a comparatively-small recurring fixed storage charge"
Better than nothing though
And that reason is perfectly summarized by this post: anyone reading this post is likely to put Vercel on a mental do-not-use list.
This is also the reason that cloud providers tend to have default quotas that, among other things, limit runaway usage.
Admittedly without knowing much about it, it sounds like Vercel may be pretty immature as a business.
Edit: after commenting I saw the Vercel response. I’m leaving my comment up because that response still seems to focus on a refund being conditional on some technical justification. That’s how engineers tend to think. It’s not how successful businesspeople need to think. It seems like both the refund policy and quota/limit management may need to be reviewed.
It's true if you have friends in Amazon, or you manage to appear on ycombinator or have a few thousand twitter followers. I've known at least three students end up with bills of around $100, which to them are huge, and which weren't waved.
And it's not like that part of it's better, they still have to pass on weirdness from registrars. I tried registering .md and that was failing. Probably not on their end but they didn't do anything extra like warn me it could happen or provide a helpful error message.
(I got excited about Zeit when it was going to be similar to Google Cloud Run or fly.io and am less interested in serverless that means things like database bouncers or using old versions of Node.js)
He was explaining his plan to add 2 new methods to an existing API and ended with a cost calculation where based on projected usage, it would cost the company $13/month, and growing over time.
I was shocked at the amount as this is a tiny piece of a massive project but equally shocked about us now requiring to think like this. To decipher real monetary cost, line by line.
I guess that's why there's a new profession: cloud cost optimization engineer. Not for me though, I stand by my god given right to ship shitty code without consequences.
If that doesn't work, I'll become a cloud cost optimization engineer imposter. I start with intentionally expensive code, erase any trace that I had any hand in it, then come in to fix it. I take a 50% commission from the savings.
The flip side is that they’ve been rock solid for years on their free plan. Super reliable and nothing but positive things to say about that tier.
Kinda surprising they wouldn’t forgive the $3k bill. That’s the cost of a nice MacBook Pro for a runaway experiment. You’d expect this sort of thing in ML training, not webdev…
I might be way off, but this would cost under $100 on all of them and you would most likely get a refund if you talked to support.
So why is Vercel so expensive? Do they not have a pricing limits that you can set? Seems like a very bad idea to run functions that are cost per usage on a service that has no way for you to set limits on usage.
I suspect the user made a mistake of deploying a traditional web app (where there is a main process that route requests and wait indefinitely for next requests) instead of deploying individual "function" that terminates gracefully after handling the request. Seems to be an honest mistake to make for first time user. In other platform, his process will be killed by the timeout limit (serverless platform usually has a strict timeout limit) but for some reason, in vercell it keep on running forever and racked up a huge bill.