Cloudflare

Introducing on-demand CPU and memory profiling with flamegraphs for Workers and Durable Objects

Oct 9, 2026Dominik Picheta
Introducing on-demand CPU and memory profiling with flamegraphs for Workers and Durable Objects
SummaryAI, from the source post

Introduces on-demand CPU and memory profiling for Cloudflare Workers and Durable Objects, accessible via the CLI and dashboard. This feature allows engineers to capture and inspect interactive flamegraphs of production execution, providing detailed insights into function-level CPU time and memory allocations. The post details the internal implementation challenges, such as locating active isolates and Durable Object primaries, and provides examples of how this profiling capability was used internally to identify and fix performance bottlenecks (e.g., recursive JSON replacer, duplicate metric calls) and memory issues (e.g., partially disabled Prometheus instrumentation). It also explains the process of profiling an isolate without stopping the Worker, holding the isolate lock only for profiler lifecycle operations.

More from the Observability Platform trail