workers-profiling

Perfila o depura el uso de CPU y la asignación de memoria en Cloudflare Workers y Durable Objects implementados. Luego, usa esta información para optimizar tu código.

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.

Más skills de cloudflare

add-autogate
cloudflare
Guía paso a paso para agregar un nuevo autogate a workerd para la implementación gradual de cambios riesgosos, incluyendo registro de enumeraciones, mapeo de cadenas, patrón de uso y…
add-autogate
cloudflare
Guía paso a paso para agregar un nuevo autogate a workerd para la implementación gradual de cambios riesgosos, incluyendo registro de enum, mapeo de strings, patrón de uso y…
add-compat-flag
cloudflare
Guía paso a paso para agregar una nueva bandera de compatibilidad a workerd, incluyendo esquema capnp, uso en C++, pruebas y requisitos de documentación.
add-compat-flag
cloudflare
Guía paso a paso para añadir una nueva flag de compatibilidad a workerd, incluyendo el esquema capnp, el uso en C++, las pruebas y los requisitos de documentación.
agents-sdk
cloudflare
Construye agentes de IA en Cloudflare Workers usando el Agents SDK. Carga al crear agentes con estado, flujos de trabajo duraderos, aplicaciones WebSocket en tiempo real, tareas programadas,…
architecture
cloudflare
Úsalo al navegar por el código base por primera vez, al agregar un nuevo método de cliente, al agregar un nuevo controlador/servicio de contenedor, o al entender cómo fluye una solicitud…
basin
cloudflare
Crea y soluciona problemas de flujos de trabajo de análisis de Cloudflare Basin con Basin Pipelines, Basin Catalog y Basin SQL. Úsalo para transmitir datos a tablas Iceberg de R2, administrar catálogos o consultar esas tablas; también para solicitudes que usen los nombres anteriores Data Platform, Pipelines, R2 Data Catalog o R2 SQL.
data-analysisawsdatabase
bazel-test-hygiene
cloudflare
Reglas obligatorias para ejecutar pruebas de bazel durante el desarrollo. Carga esta skill antes de ejecutar cualquier comando de prueba de bazel, especialmente al validar correcciones o…