Skip to content

perf(cloud): Smart Placement soak on staging (#15513) - #15521

Merged
lalalune merged 1 commit into
developfrom
perf/smart-placement-staging
Jul 8, 2026
Merged

lalalune merged 1 commit into
developfrom
perf/smart-placement-staging

Conversation

@NubsCarson

Copy link
Copy Markdown
Member

Part of #15513 (Fix B from the #15502 decomposition) — staging soak leg.

Summary

  • placement = { mode = "smart" } on [env.staging] only
  • With pass-through (perf(cloud): opt-in pass-through streaming for openai-compatible providers (8x gateway overhead) #15437) live, the gateway's own gates cost ~91ms warm — but client ttfb is still ~740ms vs ~130ms direct to Cerebras. The residual is the Worker→origin network hop (Worker executes in the caller's colo, pays fresh cross-network transit to api.cerebras.ai / api.openai.com on every call). Smart Placement is Cloudflare's mechanism for exactly this shape: it observes the Worker's subrequest pattern and moves execution near the origin.

Rollout

  1. This PR: staging only. Placement analysis takes a little while to kick in after deploy (CF docs).
  2. Measure warm chat-completions ttfb on api-staging.elizacloud.ai before/after (baseline captured today: warm ~0.75–1.0s ttfb, passthrough engaged). Also sanity-check an app/auth route for regression — placement moves the WHOLE Worker, so client-near routes could see +RTT; the inference-dominant traffic mix should still win.
  3. If it holds: [env.production] in its own one-line change.

Rollback = remove the line + redeploy (or mode = "off").

Verification

bunx wrangler deploy --env staging --dry-run parses + bundles clean (16052.92 KiB, same as develop).

🤖 Generated with Claude Code

Run the API Worker near the origins it fetches (api.cerebras.ai /
api.openai.com) instead of near the caller. With pass-through live the
preforward gates cost ~91ms warm, but client ttfb is still ~740ms vs 130ms
direct — the residual is the Worker->origin network hop Smart Placement
exists to remove. Staging-only until the before/after ttfb comparison on
api-staging holds; production follows in its own change.
@claude

claude Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

@lalalune

lalalune commented Jul 9, 2026

Copy link
Copy Markdown
Member

Project 12 agent verification: this staging Smart Placement PR is merged; its source change is present on develop, the subsequent production leg merged in #15551, and the linked issue now records both rollout commits. Moving from Needs-agent-verify to needs-human-verify; only maintainers/board owners should mark Done. [codex-agent]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: needs-human-verify

Development

Successfully merging this pull request may close these issues.

2 participants