Introducing on-demand CPU and memory profiling with flamegraphs for Workers and Durable Objects
Blog post from Cloudflare
Cloudflare has introduced on-demand CPU and memory profiling for Workers and Durable Objects, allowing developers to capture production profiles through the dashboard or CLI, inspect interactive flamegraphs, and download pprof files for deeper analysis. The feature identifies functions consuming the most CPU time or memory allocations, with source maps recommended for readable TypeScript function names, and requires sufficient live traffic because it profiles existing production isolates rather than starting new ones. Cloudflare describes internal examples in which CPU profiling revealed redundant recursive JSON processing and duplicate metrics calls, while heap profiling exposed partially disabled Prometheus instrumentation that caused memory-limit evictions; addressing these issues improved performance and reduced peak memory usage. The system accounts for Workers’ distributed, replicated execution model and can target a particular deployed version, while Durable Object profiling can locate a named stateful object on its active host. Profiling is designed to permit normal request processing during sampling, but its manually initiated and time-limited nature can miss infrequent events or startup allocations, leading Cloudflare to develop continuous profiling capabilities.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| Observability | 4 | 3,088 | 747 | 186 | +11% |
| Platform Engineering | 1 | 2,014 | 399 | 102 | +19% |
| Serverless | 1 | 1,387 | 327 | 109 | +13% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.