Skip to content

Pre-warm the app plane on requests that do not need it - #2072

Merged
RhysSullivan merged 1 commit into
mainfrom
perf/prewarm-app-plane
Sep 19, 2026
Merged

RhysSullivan merged 1 commit into
mainfrom
perf/prewarm-app-plane

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Cold app-plane dispatches are the largest share of dashboard latency: 30% of /api/* requests land on an isolate that has not evaluated the app graph and pay ~2 s (p50) against ~100 ms warm. Only 43% of those isolates are under 5 s old. The rest have been alive serving /mcp, discovery documents, or proxies, none of which enter the app graph.

This change starts the app-plane import in the background (ctx.waitUntil) on any request that does not itself need it, including the every-minute cron, so a dashboard call arriving later on that isolate finds the graph evaluated. The import is memoized as a promise so a pre-warm and a real request racing on a fresh isolate share one import; a failed import is not memoized.

Expected effect: the entered=false share of worker.dispatch spans with executor.dispatch.plane=app drops from ~30% toward the fresh-isolate floor (~13%). The truly fresh isolate still pays; that is the graph's own evaluation cost and is a separate change (moving the MCP session Durable Object's imports behind a lazy boundary).

Verification after deploy, Axiom, executor-cloud dataset:

['executor-cloud'] | where name=="worker.dispatch" and tostring(['attributes.custom']['executor.dispatch.plane'])=="app"
| extend entered=tostring(['attributes.custom']['executor.app_graph.entered']), ms=duration/1ms
| summarize n=count(), cold=countif(entered=="false"), p50=round(percentile(ms,50)), p95=round(percentile(ms,95)) by bin(_time,1h)

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing b3c9633 Commit Preview URL

Branch Preview URL
Sep 19 2026, 04:05 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud b3c9633 Sep 19 2026, 04:07 AM

@github-actions

github-actions Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Sep 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@2072

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@2072

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@2072

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@2072

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@2072

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@2072

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@2072

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@2072

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@2072

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@2072

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@2072

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@2072

executor

npm i https://pkg.pr.new/executor@2072

commit: b3c9633

@RhysSullivan
RhysSullivan marked this pull request as ready for review September 19, 2026 04:13
@RhysSullivan
RhysSullivan merged commit 1aa6fd9 into main Sep 19, 2026
44 checks passed
@RhysSullivan
RhysSullivan deleted the perf/prewarm-app-plane branch September 19, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant