pat
CDCloudflare Developers
•Created by pat on 2/2/2025 in #workers-help
Help debugging high CPU time in worker
Hey guys I really need some help to understand why I am seeing such a huge CPU time for a cloudflare worker. I am talking in the hundreds of ms which seems completely unexpected to me. I have attached a profiler from the worker that maybe someone with more experience in reading it can give me some hints because I've been studying it closely for some time and I feel like I am only extremely slowly inching closer to understanding.
This worker is a queue consumer and producer. It produces recursively until enough tasks have been run. Basically all it does is async calls to an external api and db calls. One run of the queue handler would be around 10 fetches and ~40 db calls but in a transaction. I'm using kysely to access my db in a transaction and twisted to access the external api.
3 replies