deploy_feedback
deploy_feedback copied to clipboard
deploy docs should be explicit that it's _CPU_ time
CPU Time per request | 10ms | 50ms
https://deno.com/deploy/docs/pricing-and-limits
This row has caused some confusion with "time per request" i.e. that 10ms is the maximum time a request can take before responding, rather than the total CPU time.
This could be made cleared by either: have another row directly after this (as "time per request | unlimited (?!)"), or comment explicitly that CPU time != time.
Also confused with the "CPU time limit" thing.
Written some tests: https://github.com/rhapsodyn/fresh-foo/blob/master/routes/api/timeout.ts, but haven't seen any 500 yet.
I was searching for this answer. I was wondering if I could even run a query without getting a 500. Good to know it's actual CPU time and not runtime.
import { delay } from "https://deno.land/[email protected]/async/mod.ts";
import { serve } from "https://deno.land/[email protected]/http/server.ts";
const DEFAULT_TIMEOUT = 0;
serve(async (req: Request) => {
const ms = new URL(req.url).searchParams.get("ms");
const timeout = parseInt(ms) || DEFAULT_TIMEOUT;
await delay(timeout);
return new Response(`delayed ${timeout/1000} seconds`)
});
I tried with ?ms=600000
to demonstrate response can take >10 minutes. (I have not tested with larger numbers.)
In testing again it seems like 60s is the cut off. Longer than that and I am now seeing (when using curl):
$ time curl "https://funny-ferret-64.deno.dev?ms=61002" curl: (92) HTTP/2 stream 1 was not closed cleanly before end of the underlying stream curl "https://funny-ferret-64.deno.dev?ms=61002" 0.02s user 0.01s system 0% cpu 1:00.18 total
This may well be a bug, of course.