workers-profiling

作成者: cloudflare

デプロイ済みのCloudflare WorkersとDurable Objectsで、CPU使用率とメモリ割り当てをプロファイリングまたはデバッグします。その情報を使ってコードを最適化します。

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のその他のスキル

add-autogate
cloudflare
新たなautogateをworkerdに追加して、リスクのある変更を段階的にロールアウトするためのステップバイステップガイド。enum登録、文字列マッピング、使用パターンなどを含む…
add-autogate
cloudflare
リスクの高い変更を段階的にロールアウトするために、workerdに新しいオートゲートを追加するためのステップバイステップガイド。列挙型の登録、文字列マッピング、使用パターンなどを含みます。
add-compat-flag
cloudflare
workerdに新しい互換性フラグを追加するためのステップバイステップガイド。capnpスキーマ、C++での使用法、テスト、およびドキュメント要件を含む。
add-compat-flag
cloudflare
workerdに新しい互換性フラグを追加するためのステップバイステップガイド。capnpスキーマ、C++の使用、テスト、ドキュメント要件を含む。
agents-sdk
cloudflare
Cloudflare Workers上でAgents SDKを使用してAIエージェントを構築します。ステートフルなエージェント、耐久性のあるワークフロー、リアルタイムWebSocketアプリ、スケジュールタスクを作成する際に読み込んでください…
architecture
cloudflare
コードベースを初めてナビゲートするとき、新しいクライアントメソッドを追加するとき、新しいコンテナハンドラ/サービスを追加するとき、またはリクエストの流れを理解するときに使用します…
basin
cloudflare
Basin Pipelines、Basin Catalog、Basin SQL を使用して、Cloudflare Basin の分析ワークフローを構築し、トラブルシューティングします。ストリーミングデータを R2 Iceberg テーブルに取り込む、カタログを管理する、またはそれらのテーブルをクエリする場合に使用します。また、旧称の Data Platform、Pipelines、R2 Data Catalog、R2 SQL を使用したリクエストにも対応します。
data-analysisawsdatabase
bazel-test-hygiene
cloudflare
開発中にbazelテストを実行するための必須ルール。特に修正の検証時など、bazelテストコマンドを実行する前にこのスキルをロードしてください。