blog.cloudflare.com 9 Oct 2026, 13:00 UTC

Cloudflare Adds CPU and Memory Profiling to Workers and Durable Objects

Cloudflare Adds CPU and Memory Profiling to Workers and Durable Objects
CyberSIXT Evidence Panel Source marked as original reporting

CLOUDFLARE has introduced on-demand CPU and memory profiling for its Workers and Durable Objects, enabling developers to generate interactive flamegraphs to see exactly where code is consuming resources. The feature is accessible from the Workers Observability page, and profiles can be obtained via the CLI or the Cloudflare Dashboard.

The CLI command uses the cf package to request a profile for a specific worker version and duration, while the dashboard allows you to choose the Worker, its version, and the flamegraph view. The profiler captures production execution and renders flamegraphs where each block represents a function, with width indicating CPU time or memory usage. Users can drill into functions and rely on source maps for TypeScript projects to avoid obfuscated names.

The article provides practical examples and workflow notes. It describes identifying optimization opportunities through CPU profiles (e.g., a JSON replacer function and a heavy metrics call) and highlights how profiling helped resolve memory issues by isolating and removing lingering Prometheus instrumentation that was partially enabled. It also explains the timing and locking model for profiling without stopping a Worker, and how Durable Objects profiling targets a specific named object anywhere in the world.

Limitations are acknowledged: sessions must be explicitly started, and memory profiling only shows allocations within the profiling window. Cloudflare notes ongoing work toward continuous profiling to automatically capture profiles and make detection of rare issues easier, along with guidance to follow its profiling documentation.

View full article

Article by CyberSIXT