Reduce Vercel E2E polling load - #3316
Conversation
🦋 Changeset detectedLatest commit: 2691538 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Workflow Benchmarkscommit Backend:
📈 STSO distribution vs main (inline / queue-hop histograms)1020 steps (inline) Cumulative STSO time: main 144885ms → this run 136335ms (Δ -8550ms, -6%) 1020 steps (queue-hop) Cumulative STSO time: main 2849ms → this run 2460ms (Δ -389ms, -14%) ℹ️ Metric definitions & methodologyThe collapsed STSO distribution section above buckets every step gap of the sequential-steps run (not a sampled window), split by whether the step ending the gap ran inline — in the same warm process as the step before it, so the gap is pure framework overhead — or after a queue-hop — the first step of a fresh process, which pays queue dispatch, client reinit and event-log replay. Bars overlay the two runs: Best/P75/P90/P99 deltas compare against the most recent benchmark run on Metrics — TTFS: time to first step body (in-deployment start() → first step body, deployment clocks) · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (whole-run time outside step bodies, in-deployment anchored) · SL: stream latency (in-deployment write → read propagation, readAt - writtenAt) · SO: stream overhead (end-to-end write+consume time beyond the modelled generation window) Scenarios — step: one trivial no-op step, no stream; no hooks, so the run stays in turbo mode (in-process fast path) · stream: one streaming step; no hooks, so the run stays in turbo mode (in-process fast path) · hook + stream: registers a hook before one step, which exits turbo mode (dispatch path) · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges, and WO is the whole-run overhead outside step bodies · stream latency: parallel reader/writer steps on a dedicated stream; SL is the in-deployment write->read propagation (readAt - writtenAt) · stream overhead (text): writer streams 300 variable-length text token deltas paced at 100/s for 3s (a haiku-size LLM's token throughput) while a parallel reader drains the whole stream; SO is the end-to-end write+consume time beyond the 3s generation window (overhead/backpressure) · stream overhead (structured): same workload as stream overhead (text), but each delta is an AI-SDK-style structured object ({ type: 'text-delta', id, text }) instead of a raw string, so the SO gap vs the text scenario is the added serialization cost 🔴 marks a percentile over its target (within target is left unmarked). Targets (p75/p90/p99, ms) — TTFS 200/300/600 · SL 50/60/125 · SO 250/500/1000 All metrics are measured from deployment-side timestamps only. Runs are triggered by an in-deployment route that stamps the anchor ( Cold starts are kept in the numbers on purpose — they are part of real bursty-workload latency. The workbench deployment cold-starts the |
🧪 E2E Test Results❌ Some tests failed ❌ Failed E2E Tests💻 Local Development (11 failed)astro-stable-quickjs (1 failed):
express-stable-quickjs (1 failed):
fastify-stable-quickjs (1 failed):
hono-stable-quickjs (1 failed):
nextjs-turbopack-canary-quickjs (1 failed):
nextjs-turbopack-stable-quickjs (1 failed):
nextjs-webpack-stable-quickjs (1 failed):
nitro-stable-quickjs (1 failed):
nuxt-stable-quickjs (1 failed):
sveltekit-stable-quickjs (1 failed):
vite-stable-quickjs (1 failed):
📦 Local Production (11 failed)astro-stable-quickjs (1 failed):
express-stable-quickjs (1 failed):
fastify-stable-quickjs (1 failed):
hono-stable-quickjs (1 failed):
nextjs-turbopack-canary-quickjs (1 failed):
nextjs-turbopack-stable-quickjs (1 failed):
nextjs-webpack-canary-quickjs (1 failed):
nitro-stable-quickjs (1 failed):
nuxt-stable-quickjs (1 failed):
sveltekit-stable-quickjs (1 failed):
vite-stable-quickjs (1 failed):
🐘 Local Postgres (12 failed)astro-stable-quickjs (1 failed):
express-stable-quickjs (1 failed):
fastify-stable-quickjs (1 failed):
hono-stable-quickjs (1 failed):
nextjs-turbopack-canary-quickjs (1 failed):
nextjs-turbopack-stable-quickjs (1 failed):
nextjs-webpack-canary-quickjs (1 failed):
nextjs-webpack-stable-quickjs (1 failed):
nitro-stable-quickjs (1 failed):
nuxt-stable-quickjs (1 failed):
sveltekit-stable-quickjs (1 failed):
vite-stable-quickjs (1 failed):
📋 Other (7 failed)e2e-local-dev-nest-stable-quickjs (1 failed):
e2e-local-dev-tanstack-start-node (1 failed):
e2e-local-dev-tanstack-start-quickjs (1 failed):
e2e-local-postgres-nest-stable-quickjs (1 failed):
e2e-local-postgres-tanstack-start-quickjs (1 failed):
e2e-local-prod-nest-stable-quickjs (1 failed):
e2e-local-prod-tanstack-start-quickjs (1 failed):
E2E Test SummarySummary
Details by Category✅ ▲ Vercel Production
❌ 💻 Local Development
❌ 📦 Local Production
❌ 🐘 Local Postgres
✅ 🪟 Windows
❌ 📋 Other
✅ vercel-multi-region
|
| statuses: read | ||
| strategy: | ||
| fail-fast: false | ||
| max-parallel: 6 |
There was a problem hiding this comment.
Not sure about this - it'll make CI take a total of 50 minutes to run, quite annoying
There was a problem hiding this comment.
yeah thought it might lower the load further. will skip for now
|
No backport to This commit introduces a new user-configurable runtime setting ( To override, re-run the Backport to stable workflow manually via |
Summary
Run.returnValuepolling interval configurable withWORKFLOW_RETURN_VALUE_POLL_INTERVAL_MSWhy
The Vercel E2E matrix was running many test variants concurrently, and each active
Run.returnValuewaited for completion by polling the Workflow API every second. That combined fan-out produced the recentapi-workflowtraffic spike attributed to Vercel Labs CI.This keeps the SDK default at 1 second for existing users while reducing CI polling frequency. The tradeoff is up to roughly 4 seconds of additional completion-detection latency in these E2E jobs.
Validation
pnpm vitest run packages/core/src/runtime/runs.test.ts(22 tests)pnpm --filter @workflow/core buildpnpm --filter @workflow/core typecheck.github/workflows/tests.ymlas YAMLgit diff --check