Introducing on-demand profiling: Cloudflare production examples
Dominik Picheta introduces on-demand CPU and memory profiling for Workers and Durable Objects, sharing Cloudflare examples of removing duplicate work and unnecessary allocation paths.
- Products
- WorkersDurable Objects
- Source
- Official docsCloudflare Blog
- Author
- Dominik Picheta
Key points
- Cloudflare announces on-demand CPU and memory profiles for active Workers and Durable Objects, with interactive flamegraphs and downloadable profiles.
- The article demonstrates dashboard and Cloudflare CLI capture. Production traffic exposes behavior that local tests may not reproduce.
- In the R2 binding Worker, profiling revealed redundant recursive JSON traversal. Cloudflare reports that removing it made the replacer function 2.7 times faster.
- A separate internal Worker retained a supposedly disabled Prometheus code path. Removing it reduced reported P999 memory from 133 MB to 118 MB.
- Capture observes an already-loaded isolate rather than starting one. Durable Objects can target a specific live actor.
- Sessions must be started explicitly; memory profiles cover allocations during that window. The article says continuous profiling is in development.
Original sources
Original source · Published
Open original sourceCloudflare announces availability on X and links the launch article, describing profiling as a way to investigate memory leaks and performance bottlenecks.
Read on 𝕏Cloudflare
@Cloudflare · Original 𝕏 post
On-demand CPU and memory profiling for Cloudflare Workers and Durable Objects is now available. Now you can quickly track down memory leaks and performance bottlenecks. https://t.co/As9WdNM8iH
More to read
Four layers of cost protection for small Cloudflare projects
David Z (@davezfr) writes an X article for vibe coders on budget alerts, stop conditions for paid paths, automatic pausing, and letting a personal agent verify and pause.
shmily7: a Durable Object alarm loop and a reported US$10,811.41 bill.
@shmily7 reports a Durable Object alarm loop in an unused test project, then says he paid the full US$10,811.41 bill to avoid service suspension. Cloudflare’s Ashley Peacock publicly says he is looking into it internally and will follow up. Cloudflare’s Dane Knecht later replies that he escalated it too. On October 9 the author declares the case closed: he reports that, with Ashley Peacock’s help, Cloudflare decided to refund the charges incurred during the bug in full, with the money still to arrive, and posts the support ticket reply he received.
Budget alerts
Cloudflare documents account-wide spend alerts and their notification limits.