Mike Shoebox ๐Ÿ”œ MIXTRESS at RECON Profile picture
Apr 5, 2023 โ€ข 11 tweets โ€ข 4 min read โ€ข Read on X
Attention Vercel users. Be careful what you test or deploy to Vercel. I decided to try out Vercel on a new project -- a very basic Astro deployment with a few pages, but a small mistake in our code caused us a $3000 bill in just 6 hours! ๐Ÿงต
Image
Image
Vercel said it was a "runaway process" or uncaught exception in our code which caused subsequent failures (costing $500 per hour). I had no idea the bill was continuously growing this fast and this could have easily cost me $30k in a few days if I didn't notice it.
This was just a test project and not open to the public. It was the first time I used Vercel and wanted to simply try out their CICD. This same code did not cause this kind of usage deployed to AWS.
Vercel wouldnt forgive the bill. I'm under the impression that I stupidly tried to force Prisma to work on Vercel or I had some uncaught exception that caused serverless function timeouts. Easy mistake to make! On the surface our code does not have any indication of recursion.
The other mistake was perhaps related to trying to implement tRPC incorrectly. We should have used router.createCaller as a server to server operation instead of using the client implementation. However I think the culprit is just the lack of a catch block on the fetch request.
However this still does not explain why there are 500k requests, or runaway recurring usage on brand new project that should be getting 0 traffic. At most the issues would be a long running query or slow cold start or something like that or perhaps a timeout connecting to mysql.
Vercel says these types of issues can happen on their serverless arch because there are no limits, making runaway usage like this very possible, but also the fault of the developer who decided to deploy their code to Vercel.
To be fair, I did get alarms from Vercel while on the Hobby plan. I simply shouldnt have upgraded to Pro without understanding what was happening first. I only upgraded so I could continue my testing. I didn't know it was costing that much.
I would say, I want to continue using Vercel. I mean, it looks awesome, but if a small mistake can cause this kind of issue, there's no way I'll go back. I mean, I'm still not 100% sure what the problem was so how can I confidently use Vercel for CICD going forward?
Anyway, I hope this helps other people avoid the same mistakes I made. I guess just be very careful when using novel packages on serverless arch. Do not push code that has mistakes to Vercel?? Do not put untested code on a Pro plan. Or just don't use Vercel.
As for me, I've moved the project to AWS using SST to deploy it, and things are working just fine. It's a project for a 501c3 nonprofit which has free AWS credits, and so far I've not seen the same issues I saw on Vercel. Thanks for reading! ๐Ÿ‘ โœŒ๏ธ

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Mike Shoebox ๐Ÿ”œ MIXTRESS at RECON

Mike Shoebox ๐Ÿ”œ MIXTRESS at RECON Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(