Confused about "mean CPU Time" and "50ms" limit 😅

I apologise in advance, I've read the documentation but still confused. Free plan says 10ms GPU time / invocation. But my worker has a Median CPU Time 37.6 ms. Was expecting the worker to fail with an HTTP error due to the limit. The worker still works however? I'm happy to move to the paid plan, but need to understand this better, as I don't want to risk any workers failing unexpectedly if they go over the 50ms limit from the paid plan. Sorry for not understanding the docs on this, help would be appreciated.
4 Replies
Chaika
Chaika•15mo ago
I believe the general advice is that if your p50 is consistently above the limit, you may start to see errors. CF is pretty generous with spikes and such, free plan might have more sway room as well, not sure
Paxilius
Paxilius•15mo ago
ok thank you! Was wondering if it just meant that if it goes to 30ms it just counts as 3 invocations. @chaika.me good to know though, so I can get an idea if I have to tweak a worker and know in advance if it would fit the paid plan
Chaika
Chaika•15mo ago
nah it's a hard cut off, if you consistently breach it or have request that goes way past it, your worker will just return an error. On Workers Paid, you can use Unbound plan which you pay for duration (not cpu time) and then workers running longer would cost you more, but on Bundled or Free, it's just a limit
Paxilius
Paxilius•15mo ago
thanks a ton that clarified a lot! anyway i'm surprised by how fun and easy it's to make workers, cloudflare deserve a massive shoutout
Want results from more Discord servers?
Add your server