Skip to content

Advertisement

DevOps Society
CloudNews

Cloudflare Workers Profiling Comes to Production as Deno Team Joins

Cloudflare added on-demand CPU and memory profiling for production Workers and Durable Objects, and brought in the Deno team as Deno Deploy winds down over six months.

Published your local timeupdated

Cloudflare Workers Profiling Comes to Production as Deno Team Joins

Cloudflare Workers profiling now works in production. Cloudflare said on 9 October that developers can capture CPU and memory profiles on demand from Workers and Durable Objects serving live traffic, which until now was something serverless teams mostly had to guess at or reproduce on a laptop.

Teams running on Workers can trigger a CPU or heap profile against a deployed version from the dashboard, the cf command line tool or the API, and download the result in pprof format. Anyone close to CPU limits or the 128 MB memory limit should try it on their busiest Worker. The same day, Cloudflare said the team behind Deno is joining the company, and Deno Deploy will shut down in six months, so Deno Deploy customers need a migration plan.

How does Workers profiling work?

According to the Cloudflare blog post by Dominik Picheta, the profiler attaches to an isolate that is already running real traffic rather than starting a fresh one. For CPU profiles, a V8 sampler records the call stack every millisecond. The runtime releases the isolate lock while it captures, so requests keep running, then takes the lock back to stop and collect the profile.

The documentation sets a capture window of 1,000 to 50,000 milliseconds. The dashboard defaults to 10,000. There are two profile types. CPU shows where execution time goes. Heap records a stack trace for every 512 kB allocated, which means it measures allocations during the window and not memory that is retained. It is not a heap snapshot.

Durable Objects get special handling. A regular Worker is stateless, so the platform picks a running isolate at random. A Durable Object can be profiled by name, and Cloudflare routes the request to the machine that hosts that object's live instance. For the CLI and API, that means passing a namespace ID and an actor ID.

Output is raw pprof. The dashboard draws it as a flamegraph and a sortable table, and the CLI writes binary pprof to standard output. API tokens need the Workers Scripts Read permission or the Content Read-Only role. TypeScript teams should turn on source maps. Wrangler uploads them by default from version 4.150.0.

What did Cloudflare find with it?

Cloudflare used the tool on its own Workers first and shared three results.

In a Worker in front of R2, a JSON replacer function took more than 5% of CPU time because it called itself recursively and processed nested values several times over. Cloudflare said the fixed function was 2.7 times faster. A second profile turned up a duplicate call to a metrics function that cost about 1% of CPU.

The memory example is the one to remember. A heap profile on an internal Worker showed Prometheus instrumentation code making about 66.7% of allocations, even though it was meant to be switched off. Removing it cut 99.9th percentile memory from 133 MB to 118 MB. That moved the Worker from above the 128 MB limit to about 10 MB under it.

What are the limits?

Profiling is on demand only. The target has to be getting traffic during the window, and starting a capture does not run your code. Low-traffic Workers can be hard to catch, and the docs list errors such as no recent executions or no loaded isolate, both fixed by sending traffic and retrying.

Startup allocations will not show up in a heap profile. Cloudflare said it is already working on continuous profiling but gave no date, and neither the post nor the docs say which plans include the feature.

Why is the Deno team joining Cloudflare?

The Deno news matters more for teams that want Workers without Cloudflare. The New Stack reported that Cloudflare is acquiring the team behind Deno, the runtime co-founded by Node.js creator Ryan Dahl, and that terms were not disclosed.

According to the Deno announcement, Deno Deploy will run for six more months and then shut down, with migration help for paying customers moving to Workers. The Deno runtime gets another year of monthly releases with bug fixes and security updates, after which development ends. JSR, the package registry, keeps running on Cloudflare infrastructure.

The bigger plan involves celld, a project Dahl launched in August that recreates the Workers and Durable Objects model for self-hosting. The New Stack reported that Cloudflare intends to fold it into workerd, its open source Workers runtime, with Dahl and Deno co-founder Bert Belder leading the work. Cloudflare principal engineer Kenton Varda conceded the company had not done a good job building an ecosystem around workerd. Dahl's view was blunt: "only the open version wins here."

What should platform teams do now?

If you run Deno Deploy, start the inventory now. Six months from 9 October puts the shutdown around April 2027, and nobody wants to migrate in the last month.

If you run Workers, add a profile capture step to the runbook for CPU limit errors and out-of-memory alerts. It takes a few seconds and beats guessing.

A self-hosted workerd fleet that behaves like Cloudflare's own platform would be a real option for teams with data residency rules. It is a promise for now, and it is worth watching what ships before betting a platform on it.

Advertisement

Follow DevOps Society on LinkedIn

Practical infrastructure engineering in your feed.

Follow

Written by

DevOpsSociety Editorial Team

Editorial Team

The DevOpsSociety Editorial Team covers DevOps, cloud infrastructure, Kubernetes, AI infrastructure, platform engineering, cybersecurity, FinOps, and modern engineering practices. We publish practical insights, technical guides, architecture analysis, and research for engineers and technology leaders.

More from DevOpsSociety →
The Infrastructure Briefing

Get the infrastructure briefing.

Practical DevOps, cloud, AI infrastructure and engineering insights, delivered weekly. Read by engineers and engineering leaders.

No spam. Unsubscribe anytime.

Cloudflare Workers Profiling Comes to Production as Deno Team Joins, DevOps Society