Skip to content

Run Axum Next.js transport measurements in GitHub Actions - #1634

Draft
prk-Jr wants to merge 6 commits into
spec/edgezero-pr275-migrationfrom
docs/1585-axum-client-measurements
Draft

prk-Jr wants to merge 6 commits into
spec/edgezero-pr275-migrationfrom
docs/1585-axum-client-measurements

Conversation

@prk-Jr

@prk-Jr prk-Jr commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add a repeatable #1585 HTTP-client lifetime measurement through the real managed Axum runner, with GitHub Actions summaries and downloadable evidence. The existing EdgeZero cutover already shares its underlying transport, and the selected Next.js regression did not reproduce. Preserve current production behavior; do not add another pool.

Ownership: these application-level measurements belong in Trusted Server. Transport construction, pooling, budgets, cancellation and streaming remain EdgeZero functionality. No SDK correction was demonstrated or implemented. This does not complete EdgeZero #394's broader streaming acceptance or the settings/registry/store lifetime work in #1623.

Stacked on #1506 (spec/edgezero-pr275-migration). The original local measurement used its pinned head: Trusted Server feaf3df5d1c9bb2dca64158480725cb555ab9c26, EdgeZero 9d02d7b3185b49e81d9ac972ca3feef932ed848a. Main's old per-request client was not the measured implementation. The workflow now builds its checked-out branch directly, so the prerequisite and consumer stay together. Dependency order is unchanged; the stack was joined with a history-preserving merge, without rebasing or force-pushing.

Findings and numbers

  • 204 upstream requests on 18 used TCP connections. One socket served 78 requests, including all 30 historical POST → API GET pairs. Each of those 60 incoming requests used a fresh TCP connection, so this distinguishes upstream reuse from incoming keep-alive.
  • Historical POST bodies arrived as exactly []; 15 chunked incoming POSTs were correctly reframed with Content-Length 2 upstream.
  • 18 real action → redirect → return cycles passed per target, directly against Next.js and through managed Axum: 15 hydrated actions and three JavaScript-disabled forms. All action responses were 303, destination token/cookie checks passed, and four browser contexts also ran concurrently.
  • Empty input, an 81,920-byte paced chunked upload, 48 concurrent distinct uploads per target (up to 163,840 bytes), cookie isolation, and explicit 303/307/308 follow-up method/body/cookie checks passed.

Final-run milliseconds, median / p95:

Workload Samples per target Direct Next.js Managed Axum
Historical POST 30 7.187 / 8.975 9.610 / 12.088
API GET 31 0.714 / 1.183 1.376 / 2.568
Concurrent echo 48 87.652 / 98.670 97.223 / 113.936
Browser load/action/redirect/return 18 133.410 / 231.622 133.796 / 384.728

These are sequential local direct-versus-managed path measurements, not a causal pooled-versus-fresh comparison. Chunked uploads include intentional pacing; browser cycles include loading and return navigation. A fresh outbound transport comparison was unnecessary because the current transport already reuses connections and the selected correctness checks pass.

Counterevidence retained: the first proxied real action was rejected by Next.js's origin check despite the complete multipart body arriving. Allowing only the fixture's exact public proxy origin in serverActions.allowedOrigins made the workflow pass while preserving browser Origin. No production Host/Origin policy changed. An unconfigured split-origin deployment can still reject actions.

The historical fixture used an unknown action ID, not a valid action/redirect. Its original root cause remains uncertain. Successful real-action checks are additional coverage, not an exact reconstruction of that old stack.

Repeatable GitHub Actions measurement

The Axum Next.js transport measurement workflow runs on relevant PR changes and supports manual dispatch when available on the default branch. It builds this branch's actual managed Axum runner with the pinned Node/Rust and locked Next/browser dependencies on Ubuntu 24.04, which the locked Playwright version supports. The initial Ubuntu 26.04 runner failed browser installation before runtime measurements; the job now pins the compatible image. The superseded attempt stalled in unrelated OS package downloads. The fixture now downloads the locked browser and retains Playwright's normal validation of the runner's preinstalled libraries, without upgrading runner packages. Correctness and reuse assertions can fail the job; timings have no pass threshold and global connection counts are observations, not a fixed target.

Each successful run writes fresh counts and median/p95 timings to the job summary and uploads raw synthetic TCP requests, parsed receipts, per-request/browser observations, source/tool/binary identity and logs. Failed runs retain available diagnostics. The historical table above remains identified as local evidence; CI numbers are separate.

Local reproduction:

bash scripts/measure-axum-nextjs/run.sh /tmp/axum-nextjs-measurement

The source preflight checks the actual managed runner/client integration, rather than requiring a historical commit to survive a squash merge. Services and browser descendants use owned process groups with bounded cleanup; the recorder flushes before analysis. The SIGTERM control stopped even a descendant deliberately ignoring SIGTERM and released all three ports.

Recorder latency control

The first successful hosted TypeScript run passed correctness and reuse checks but showed a roughly 40 ms mode in managed API timings. The plain TCP recorder still had Nagle buffering enabled. The fixture now sets TCP_NODELAY on both recorder sockets and records that setting in metadata; production transports are unchanged. The Linux control run passed: managed GET median fell from 42.760 ms to 2.405 ms while direct GET remained near 1.4 ms; POST median fell from 51.316 ms to 11.185 ms. Production source, locked SDK/tool versions and build flags match; the binaries were rebuilt and their hashes differ. This supports recorder buffering as the confounder. The runs used separate hosted VMs, so this is not a randomized causal pooling benchmark. The historical local table remains separately labeled.

Hosted measurement on the final code revision

Actions run 44516951107 passed at head fc238935290effd2db2abee6f5e417e5902798b7; the tested PR merge revision was 3922847b2173ab98abaee6a48b23c5f448079758. Its job summary contains the table and its artifact contains raw synthetic receipts, individual observations, metadata and logs.

204 upstream requests, 18 used connections; all 30 historical POSTs used one connection. All 18 action cycles per target passed (15 hydrated + 3 JavaScript-disabled), including concurrent contexts and exact cookies/bodies.

Workload Direct median / p95 (ms) Managed median / p95 (ms)
historical_post 8.21 / 12.448 11.185 / 13.424
api_get 1.425 / 2.721 2.405 / 3.312
concurrent_echo 97.342 / 118.494 101.224 / 131.158
browser_cycles 183.827 / 315.29 189.81 / 464.872

These are fresh Linux observations with recorder TCP_NODELAY enabled, separate from the original local table above. They characterize complete paths, not pooling's causal benefit.

Changes

File Change
docs/internal/measurements/2026-11-19-1585-axum-nextjs.md Transport source trace, ownership, historical workflow, methodology, observations, negative control, timings and limits
docs/internal/measurements/2026-11-19-1585-axum-nextjs-results.json Captured structured counts, socket totals, timing aggregates, environment and scenario qualifications
.github/workflows/axum-nextjs-measurement.yml Read-only workflow using the checked-out runtime, job summary and diagnostic artifacts
scripts/measure-axum-nextjs/ Shell setup and native TypeScript orchestration, real Next.js app, API/browser assertions, TCP recorder, strict evidence parser and tests
scripts/README.md Local invocation and interpretation

Related issue

Related #1585. No automatic closing keyword: the report answers the HTTP measurement question without claiming the broader SH-1 settings, registry and store criteria are complete.

Spec

Not a product feature. Measurement fixtures, automation and documentation; no production runtime, dependency or SDK behavior changes. Existing lockfiles supply fixture dependencies.

Test plan

On the measured prerequisite revision:

  • Locked native Axum and CLI build.
  • cargo test-axum: 20 library + 40 route tests passed; two documentation examples ignored.
  • cargo clippy-axum.
  • Real managed Axum, production-mode Next.js 14.2.35 and headless Chromium 145.0.7632.6 workflows described above; independent experiment/conclusion challenge.

For the report and automation:

  • Structured observations compared field-for-field with the captured summary; socket totals reconciled.
  • Documentation ESLint, Prettier and VitePress build (npm run check with Node 24.20.0).
  • Added-line URL-host lint and diff whitespace check.
  • Eight TypeScript evidence-parser/entry-point tests; 30 CI Node-pin tests; ShellCheck and Actionlint.
  • Full automated local run on the stacked runtime: 204 upstream requests on 18 used connections with recorder TCP_NODELAY, historical bodies and all action/cookie/navigation checks pass. The earlier table records the separate original local run.
  • Old pre-cutover source rejected before building; SIGTERM/process-descendant cleanup and recorder-flush control passes.
  • Independent factual/publication check plus independent automation review; lifecycle, squash-merge and CLI entry-point concerns corrected. All measurement code in the PR is TypeScript or shell; the locked compiler checks scripts before runtime execution.

No full cross-adapter CI rerun is claimed for this report. Hosted checks are separate from the captured runtime evidence. The fixture is now repeatable locally and in CI; raw traces are uploaded per run rather than committed. Scope is local HTTP/1, the pinned Next.js version and explicit allowed proxy origin; TLS/HTTP2, other versions, idle/sustained-load behavior and complete cancellation/drain qualification remain unmeasured.

Checklist

  • Only measurement automation/fixtures and documentation; no production code, dependencies, credentials or connection pool added.
  • Uses synthetic fixture data and permitted reference hosts.
  • Measurement identity, origin prerequisite, historical uncertainty and remaining acceptance scope are explicit.
  • Draft only; no reviewers requested, PR merge or deployment performed.

@prk-Jr prk-Jr changed the title Record Axum transport reuse and Next.js measurements Run Axum Next.js transport measurements in GitHub Actions Nov 19, 2026
@prk-Jr
prk-Jr changed the base branch from main to spec/edgezero-pr275-migration November 19, 2026 11:03
@prk-Jr prk-Jr linked an issue Nov 19, 2026 that may be closed by this pull request
2 tasks

This branch has not been deployed

No deployments
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.

Measure Axum's per-request HTTP client against a pooled one

1 participant