workers-profiling

Profilez ou déboguez l’utilisation du CPU et l’allocation de mémoire dans les Cloudflare Workers et Durable Objects déployés. Utilisez ensuite ces informations pour optimiser votre code.

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.

Plus de skills de cloudflare

add-autogate
cloudflare
Guide étape par étape pour ajouter un nouvel autogate à workerd afin de déployer progressivement des changements risqués, incluant l'enregistrement d'énumération, le mappage de chaînes, le modèle d'utilisation, et…
add-autogate
cloudflare
Guide étape par étape pour ajouter un nouvel autogate à workerd afin de déployer progressivement les changements risqués, y compris l'enregistrement des enums, le mappage des chaînes, le modèle d'utilisation, et…
add-compat-flag
cloudflare
Guide étape par étape pour ajouter un nouveau drapeau de compatibilité à workerd, incluant le schéma capnp, l'utilisation en C++, les tests et les exigences de documentation.
add-compat-flag
cloudflare
Guide étape par étape pour ajouter un nouveau drapeau de compatibilité à workerd, incluant le schéma capnp, l'utilisation en C++, les tests et les exigences de documentation.
agents-sdk
cloudflare
Construisez des agents IA sur Cloudflare Workers en utilisant le SDK Agents. Chargez lors de la création d'agents avec état, de workflows durables, d'applications WebSocket en temps réel, de tâches planifiées,…
architecture
cloudflare
Utiliser lors de la première navigation dans la base de code, de l'ajout d'une nouvelle méthode client, de l'ajout d'un nouveau gestionnaire/service de conteneur, ou de la compréhension du flux d'une requête…
basin
cloudflare
Créer et dépanner des workflows d’analyse Cloudflare Basin avec Basin Pipelines, Basin Catalog et Basin SQL. À utiliser pour diffuser des données dans des tables Iceberg R2, gérer des catalogues ou interroger ces tables ; également à utiliser pour les demandes faisant référence aux anciens noms Data Platform, Pipelines, R2 Data Catalog ou R2 SQL.
data-analysisawsdatabase
bazel-test-hygiene
cloudflare
Règles obligatoires pour exécuter les tests bazel pendant le développement. Chargez cette compétence avant d'exécuter toute commande de test baz