/
← Voltar ao feed
low

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

1 fonte(s) · 1 atualização(ões) · publicado 09/10/2026 10:00 · coletado há 1 dia

Cloudflare announced on-demand CPU and memory profiling for Workers and Durable Objects. Developers can request a profile of a live production Worker from the Observability page or the cf CLI, inspect it as an interactive flamegraph, and download the .pprof file. This is a product and observability announcement with no vulnerability, threat actor or attack described. Cloudflare says internal teams used the feature to speed up the R2 binding Worker and to fix an "Exceeded Memory" problem in another Worker.

Technical Details

  • The profiler uses a V8 CPU profiler sampling at a 1 ms interval. The runtime holds the isolate lock only for profiler start and stop, so requests keep running during the capture.
  • Profiling does not start a new isolate. The Worker needs enough traffic and a deployed version, and the runtime picks a running isolate of the requested Worker at random.
  • For Durable Objects, a profile can target a specific named object. The request is routed to the metal that owns the live actor.
  • Limitations: sessions must be started manually, and the memory profiler only shows allocations made during the profiling window, so start-up allocations are missed. Cloudflare says it is working on continuous profiling.
  • Internal findings: the recursive genericR2JsonReplacer was made 2.7x faster, and a duplicate metrics call was removed. A Worker with P999 memory near 133 MB against the 128 MB limit was found to be spending about 66.7% of allocations on partially disabled Prometheus code. Removing it gave about 10 MB of headroom.

Remediation

No remediation is required. Teams that use the feature should enable source maps for TypeScript Workers so function names are readable in profiles.

Linha do tempo

  1. blog.cloudflare.com ↗ · pub. 09/10/2026 10:00 · coletado 19/10 18:00 primeiro registro

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

    ler a análise desta fonte

    Cloudflare announced on-demand CPU and memory profiling for Workers and Durable Objects. Developers can request a profile of a live production Worker from the Observability page or the cf CLI, inspect it as an interactive flamegraph, and download the .pprof file. This is a product and observability announcement with no vulnerability, threat actor or attack described. Cloudflare says internal teams used the feature to speed up the R2 binding Worker and to fix an "Exceeded Memory" problem in another Worker.

    Technical Details

    • The profiler uses a V8 CPU profiler sampling at a 1 ms interval. The runtime holds the isolate lock only for profiler start and stop, so requests keep running during the capture.
    • Profiling does not start a new isolate. The Worker needs enough traffic and a deployed version, and the runtime picks a running isolate of the requested Worker at random.
    • For Durable Objects, a profile can target a specific named object. The request is routed to the metal that owns the live actor.
    • Limitations: sessions must be started manually, and the memory profiler only shows allocations made during the profiling window, so start-up allocations are missed. Cloudflare says it is working on continuous profiling.
    • Internal findings: the recursive genericR2JsonReplacer was made 2.7x faster, and a duplicate metrics call was removed. A Worker with P999 memory near 133 MB against the 128 MB limit was found to be spending about 66.7% of allocations on partially disabled Prometheus code. Removing it gave about 10 MB of headroom.

    Remediation

    No remediation is required. Teams that use the feature should enable source maps for TypeScript Workers so function names are readable in profiles.