workers-profiling

tarafından cloudflare

Dağıtılmış Cloudflare Workers ve Durable Objects'ta CPU kullanımını ve bellek tahsisini profilleyin veya hata ayıklayın. Ardından kodunuzu optimize etmek için bu bilgileri kullanın.

npx skills add https://github.com/cloudflare/skills --skill workers-profiling

Workers profiling

Find expensive functions or memory allocations in deployed code and come up with ways to fix them.

Retrieve the docs

Start with the production profiling guide to understand how Workers and Durable Objects profiling works.

Profiling steps

  1. Identify the symptom and affected workload: CPU usage, latency, allocation pressure, or memory growth.
  2. Confirm the account, Worker, environment, and deployed version with the user.
  3. For a Durable Object, also confirm its owning Worker, namespace, and instance.
  4. Choose CPU or heap profiling from the current guide's supported types and meanings.

Where possible, use the cf CLI to capture profiles. If the user requests cf, inspect the installed version's command help and schema where available.

If cf isn't available, consider prompting the user whether they would like to install it.

The profiling API will return a pprof file which you can analyze directly, or using appropriate tools like Go's pprof utility.

Inspect the evidence

  • Read the pprof file and analyse it for hotspots
  • Map hotspots to functions and source locations when evidence supports it; report missing symbols or source mappings.
  • If filenames and function names are pointing at the generated JavaScript, consider suggesting to the user to enable source maps and re-do the profiling.

Optimise

Propose the smallest code change supported by the capture which resolves the issues identified.

Report findings

Return a concise report with:

  • Evidence for each finding: file, function, source location, and metric with units, where available.
  • The smallest actionable change and how to check its effect.

Skill feedback

If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read references/skill-feedback.md.

cloudflare tarafından daha fazla skill

add-autogate
cloudflare
Riskli değişikliklerin kademeli olarak yayına alınması için workerd'e yeni bir autogate ekleme adım adım kılavuzu: enum kaydı, string eşleme, kullanım deseni ve…
add-autogate
cloudflare
Riski yüksek değişikliklerin kademeli olarak yayınlanması için workerd'a yeni bir autogate ekleme adım adım kılavuzu; enum kaydı, string eşleme, kullanım deseni ve…
add-compat-flag
cloudflare
workerd'e yeni bir uyumluluk bayrağı eklemek için adım adım kılavuz: capnp şeması, C++ kullanımı, test etme ve dokümantasyon gereksinimleri dahil.
add-compat-flag
cloudflare
workerd'e yeni bir uyumluluk bayrağı eklemek için adım adım rehber; capnp şeması, C++ kullanımı, test etme ve dokümantasyon gereksinimleri dahil.
agents-sdk
cloudflare
Cloudflare Workers üzerinde Agents SDK kullanarak AI ajanları oluşturun. Durum bilgisi olan ajanlar, dayanıklı iş akışları, gerçek zamanlı WebSocket uygulamaları, zamanlanmış görevler oluştururken yükleyin,…
architecture
cloudflare
Kod tabanında ilk kez gezinirken, yeni bir istemci metodu eklerken, yeni bir konteyner işleyicisi/hizmeti eklerken veya bir isteğin nasıl aktığını anlamak için kullanın…
basin
cloudflare
Basin Pipelines, Basin Catalog ve Basin SQL ile Cloudflare Basin analiz iş akışları oluşturun ve sorunlarını giderin. Verileri R2 Iceberg tablolarına akış olarak aktarmak, katalogları yönetmek veya bu tablolarda sorgu çalıştırmak için kullanın; ayrıca eski Data Platform, Pipelines, R2 Data Catalog veya R2 SQL adlarını kullanan istekler için de kullanın.
data-analysisawsdatabase
bazel-test-hygiene
cloudflare
Geliştirme sırasında bazel testlerini çalıştırmak için zorunlu kurallar. Bu beceriyi, özellikle düzeltmeleri doğrularken veya… herhangi bir bazel test komutunu çalıştırmadan önce yükleyin.