stochastic
stochastic
CDCloudflare Developers
Created by stochastic on 4/12/2025 in #workers-help
Startup Time Exceeded Despite CPU Profile Showing <400ms
Hey all, I'm running into a weird issue while deploying a Worker. I’m getting an error saying my Worker exceeds startup limits:
✘ [ERROR] Your Worker failed validation because it exceeded startup limits.
To ensure fast responses, there are constraints on Worker startup, such as how much CPU it can use, or how long it can take. Your Worker has hit one of these startup limits...
However, when I check the .cpuprofile, the total time seems to be around 281ms which is well under the 400ms limit for Workers startup. The flamegraph also shows the bulk of the time in functions like _Tiktoken (146.46ms), toByteArray (17.63ms), and some anonymous functions, with garbage collection taking 48.27ms. I’ve also attached a screenshot of the flamegraph and the performance breakdown. The heaviest operations seem to be in _Tiktoken and some dependency initialization (e.g., pg, pino-pretty, @libsql/client), but I don’t understand why it’s failing validation if the total time is under 400ms. Could this be related to CPU usage limits rather than time? Any tips on optimizing or debugging this further? Thanks!
7 replies