I was following the tutorial to deploy SvelteKit website through pages.
I have one +page.server.ts file where I load some json data from a public api (for test reasons).
Workers on the free plan are limited to 10ms of CPU time and the paid plan has two usage models - Bundled which has 50ms and Unbound which has up to 30 seconds but you are billed for wall-time duration when using Unbound.
Bundled sounds like it should work fine for your use-case if you upgrade? But otherwise, other than not calling json(), I can’t think of any real workaround.
And how do you “choose” between the two usage models; If I see to the paid plan, I see both, but not sure how I should select one or the other, or is this something you need to configure?
Found in the docs that you can configure it; of course, the SvelteKit deployment does not uses explicit worker functions; it’s baked into the “adapter”. So not sure if 50ms of CPU is “enough” in this case?
So if, for some reason, the http cpu time is larger than 50ms, the site goes down because of the CPU exceeding limations; how long will it be down, or only for that specific IP/user, all users?
Workers (and by extension Functions) are invoked on request - if the CPU limit is reached, that only impacts that specific request. They can just refresh the browser and try again.