Analytics & Measurement

Cloudflare Profiles Live Workers to Find Production Bottlenecks

Cloudflare Profiles Live Workers to Find Production Bottlenecks FAYFO Media © fayfo.com
Cloudflare Profiles Live Workers to Find Production Bottlenecks © fayfo.com
A production profile exposed a recursive JSON replacer repeatedly traversing nested data; Cloudflare says the fix made the Worker 2.7 times faster. The tool captures live Workers and Durable Objects without pausing normal requests.

A recursive JSON replacer in an R2 binding Worker repeatedly traversed nested data until a production profile exposed the waste. Cloudflare says correcting the code made the Worker 2.7 times faster. The example shows what the company’s new on-demand profiling can reveal: resource-heavy code running under real traffic, without first reproducing the problem locally.

Announced October 9, 2026, the feature lets developers capture CPU or heap-allocation profiles for a deployed Worker version. Results appear as interactive flamegraphs in the Workers Observability dashboard or through the cf CLI, and profiles can be downloaded for offline analysis.

Profiles From Live Isolates

The basic operational difference is where profiling runs. It targets an already-running isolate rather than launching a fresh one, so developers can inspect execution under production conditions. Wider sections in a flamegraph represent functions responsible for more CPU time or sampled memory allocations.

Cloudflare’s edge infrastructure complicates the request. A script can run across multiple isolates in different data centers and physical machines, so the platform must identify the requested Worker version and find a suitable active isolate. Durable Objects add state and location changes to the task; Cloudflare routes a request to the machine hosting the specific named object.

Captures depend on activity. The target needs sufficient traffic during the profiling window, and TypeScript developers should allow source maps to make function names easier to read.

CPU and Memory Tell Different Stories

For CPU profiling, the runtime starts a V8 profiler that samples call stacks at one-millisecond intervals. It releases the isolate lock while requests continue running, then reacquires the lock to stop profiling and collect the results. Normal request processing continues during the capture.

CPU profiles show where execution time goes, helping teams find expensive functions or repeated work. Heap-allocation profiles instead identify functions associated with sampled allocations. A function can consume large CPU while allocating little memory; another can create many objects without dominating execution time. Choosing the profile that matches the symptom narrows the search.

Cloudflare also used memory profiling to investigate partially disabled Prometheus instrumentation that was reportedly still consuming large memory. The company says removing the remaining code cut the Worker’s 99.9th-percentile memory usage from 133 MB to 118 MB, below the 128 MB limit. A separate profile found a duplicate metrics call accounting for about 1% of CPU time.

Production Debugging Has Limits

On-demand captures complement existing tools. Chrome DevTools supports local CPU profiling, though reproducing production traffic and data can be difficult. Developers can analyze downloaded profiles with pprof, which Cloudflare describes as a widely used option for Go and other supported profiling workflows.

Logs and metrics can help teams spot that a service is slow or using too many resources. Distributed tracing helps follow requests, while profiles can point to the responsible functions. Cloudflare’s profiling release is separate from its AI tools: the company has also previewed Clairic for document extraction on Workers AI, as described in this earlier report.

Short capture windows can miss intermittent problems. Heap profiles record allocations made during capture rather than providing a complete view of retained memory. Cloudflare says it is working toward continuous profiling.

Paul Christiano Editor FAYFO Media
Editor

Paul Christiano

American journalist with a strong focus on AI and content technology.

You Might Also Like