Billing limits on worker
We just set up a cloudflare worker for generating og images.
Is there any way we could force a limit of set $ per month (or something similar).
Don't want to go bankrupt if someone ddos-es the worker endpoint.
10 Replies
You can cap the amount of CPU Usage (ms) per request, and you can setup billing alerts (under Notifications) for Requests, but no way to stop it automagically
Cloudflare has free rate limiting built in if you run the worker under a custom domain of a website, can configure that to help, as well as other security controls
Alright, figured you'd have a better solution for spend caps. Will look into creating a custom solution then.
Sadly it's kind of a trend not to have them, most big clouds don't. You have alerts, and built in ddos protection, but that's about it
Yeah I'm constantly hearing about people on platforms like Vercel getting ddossed and having super large bills.
Can't wrap my head around why such an essential feature is not implemented tho. You've got infinitely scaling workers, but what's the point of that scalability if you're going to be bankrupt xd.
Seems like these kinds of limits should be easily configurable from a dashboard or smth.
Anyway, gonna look into creating a custom solution then.
Can't wrap my head around why such an essential feature is not implemented tho.If I had to guess, probably a fair amount of engineering work and reliance on separate analytics stuff to get a pipeline working like that, and then implementing some shutdown feature, and not very high priority over lots of other feature improvements. Only CF would be able to answer
what's the point of that scalability if you're going to be bankrupt xd.The one nice thing here that helps them is Workers are ridiculously cheap compared to other platforms
Haha fair enough about the pricing point.
the pricing is really awesome
It's going to depend on your cpu time a lot but $100 dollars of usage is some ~300 million requests (in per request cost, you'd have to then calculate your cpu time)
Yeah will have to do some math on my end
It's annoying that there are no notifications for a specific $ amount reached.
yea, probably because all the billing stuff/generation is completely separate
yea makes sense
Thanks for helping me out. Have a great day!