Paid Workers Plan CPU Timeout under 5 seconds

#workers-help I've set up a worker for my Sveltekit app and the app is running as expected except occasionally when trying to login. I use Scrypt for the hashing method it is randomly timing out after a 2-3 second wait on the page load I get the Worker exceeded CPU time limit error message. Is the paid plan not supposed to be able to go up to Max of 30 seconds of CPU time per invocation?, am I missing something?
11 Replies
Jonathan Riche
Jonathan RicheOP10mo ago
To clarify it works sometimes and when the login takes an extra second or so occasionally it erros out with the Exceeded CPU Limit error message the Scypt.verify is what is timeing out const validPassword = await new Scrypt().verify(checkForUser[0].hashedPassword!, password);
Razzmatazz
Razzmatazz10mo ago
Out of curiosity, are you having these errors when deployed, or when testing with wrangler dev?
Jonathan Riche
Jonathan RicheOP10mo ago
Deployed only*
Razzmatazz
Razzmatazz10mo ago
Ah I’m having a similar problem with wrangler dev but must be unrelated
kian
kian10mo ago
The Paid Plan has several usage models, check which one you're using - Bundled only has 50ms of CPU time per invocation.
Jonathan Riche
Jonathan RicheOP10mo ago
They got "migrated" to the standard plan a few days ago All users on the Workers Paid plan have been automatically migrated from the Bundled and Unbound usage models to the Standard usage model on March 1, 2024 is there a way to toggle CPU/plan now since that change?
Jonathan Riche
Jonathan RicheOP10mo ago
I tried to change the cpu_ms limit after that and its not editable : workers.api.error.cpu_ms_limit_not_allowed_for_usage_model [code: 10205] -- b/c of the message here : https://developers.cloudflare.com/workers/platform/pricing Custom limits To prevent accidental runaway bills or denial-of-wallet attacks, configure the maximum amount of CPU time that can be used per invocation by defining limits in your Worker’s wrangler.toml file, or via the Cloudflare dashboard (Workers & Pages > Select your Worker > Settings > CPU Limits). If you had a Worker on the Bundled usage model prior to the migration to Standard pricing on March 1, 2024, Cloudflare has automatically added a 50 ms CPU limit on your Worker.
Cloudflare Docs
Pricing · Cloudflare Workers docs
Workers plans and pricing information.
Erisa
Erisa10mo ago
Hi, could you DM me your account email, account ID and the Worker name that you have this issue on?
Jonathan Riche
Jonathan RicheOP10mo ago
Thanks I just sent it to you
Chaika
Chaika10mo ago
Thanks for reporting. I would watch this incident for further updates on the issue, and try again when it is resolved: https://www.cloudflarestatus.com/incidents/3q7sg3tpp7qv
Jonathan Riche
Jonathan RicheOP10mo ago
Thanks will do confirming this works on my end now thanks @Chaika @Erisa | Support Engineer
Want results from more Discord servers?
Add your server