Repository navigation
Replies: 1 comment
|
Short answers from the published limits docs, then the practical read of your measurements: 1. What 2. Why you see 8–22 ms with 3. The Flask part. The WSGI adapter realistically can't get a warm Flask app under 10 ms per request — your local profiling showing smaller warm times is consistent with deployed requests paying isolate placement and interpreter warm-up that local runs don't. On Free, the sustainable Python envelope is essentially the trivial-handler shape you already measured (~8–10 ms warm); anything stateful like Flask is sized for Workers Paid (default 30 s, adjustable to 5 min via One measurement note since you were careful about methodology: |
Uh oh!
There was an error while loading. Please reload this page.
Reproduction
Observed 9 October 2026 on Workers Free, compatibility date
2026-10-09, flagpython_workers, Wrangler4.149.0, workers-py1.17.7, workers-runtime-sdk1.9.3.Minimal Python entrypoint, with no Flask import or database access:
After deployment, six sequential requests returned 200 with
outcome: ok. Top-levelcpuTimefromwrangler tail --format jsonwas 9, 22, 10, 17, 8 and 20 ms. These are a small sample, not percentile statistics. NoexceededCpuerror was observed.A small Flask application using the supported WSGI adapter showed much larger and variable CPU use, including repeated requests. Passing a native Request into the adapter and testing bounded buffered WSGI replies did not consistently bring requests below 10 ms. Local Worker profiling showed substantially smaller warm Flask timings. Deployed cProfile function timings were zero, consistent with frozen deployed timers, so those profiler values were not used as CPU evidence.
Questions
cpuTimeinclude runtime/snapshot initialization or other overhead treated differently by the Free enforcement limit? How should cold and warm Python requests be assessed against the published allowance?References: CPU limits, Python deployment lifecycle, deployed timers.
No account identifier, deployment URL, credential, user email, private repository or application dataset is needed for this reproduction.
All reactions