Public: anyone can read this; the crew can change it.
A public page waits past 1 s in the tunnel #14338
Check · Review · Land · Live done — Landed and live in production.
This change gives cloudflared an explicit origin connection pool. It is a mitigation for the 3.9 s first byte, not a confirmed cause. I couldn't reach the host from this sandbox, so I haven't seen journalctl -u cloudflared or the tunnel's behaviour.
shipped production is serving it deploy 501b993
This change gives cloudflared an explicit origin connection pool. It is a mitigation for the 3.9 s first byte, not a confirmed cause. I couldn't reach the host from this sandbox, so I haven't seen journalctl -u cloudflared or the tunnel's behaviour. gate --fix, tsc, and the forge-box and wait-alarm tests pass here.
What changed
src/system/tunnel_config.tsnow renders a top-leveloriginRequest:block with these settings:connectTimeout: 5stcpKeepAlive: 15snoHappyEyeballs: truekeepAliveConnections: 256keepAliveTimeout: 5m
- The origin is a single loopback process, so keeping warm connections costs nothing, and a page shouldn't pay a fresh dial.
noHappyEyeballsskips the IPv4/IPv6 race, since the origin is an IPv4 literal. infra/forge-box/cloudflared-forge.ymlis updated to match whatbun scripts/tunnel-config.tswould render. I edited it by hand because that script needs the forge's database.src/maintain/wait_limits.ts(the tunnel row'swhytext) now says the config sets only the connection pool. That bounds a dial, not a response, so the row stays "no forge-held bound".test/forge-box-unit.test.tschecks that the block is rendered and comes beforeingress:.
Not done
- I did not claim the tunnel layer has a response-time bound, because none of these settings is one.
- The release-in-progress hold note applies to production, so someone has to copy the new yml to
/etc/forge/cloudflared.ymland restart cloudflared once production settles. - If the slowness comes back after that, the cause is upstream (Cloudflare's edge or its route to the host), not this config.
To try it
- Run
bun test test/forge-box-unit.test.ts. - After deploying the config, compare
/healthzfirst-byte time against the 3957 ms measured.
🤖 Generated with Claude Code
Small, single-purpose, tested, honest about being a mitigation: the originRequest keys are valid cloudflared options, the yml matches the renderer, wait_limits keeps the tunnel row as no forge-held bound, and the test pins the block and its order before ingress. No security, README or dependency concerns. Preview /healthz answered 200 with 5.0 s first byte on one cold curl; the preview does not run this tunnel config, so it neither confirms nor refutes the fix. Two things I would do next: 1) after copying the yml to /etc/forge/cloudflared.yml and restarting cloudflared, record /healthz first-byte before/after in the issue and, if still slow, move the investigation to the edge or the route; 2) make the deploy step of the config copy something the forge does or a runbook line, so a merged config change is not silently unapplied.
This change gives cloudflared an explicit origin connection pool. It is a mitigation for the 3.9 s first byte, not a confirmed cause. I couldn't reach the host from this sandbox, so I haven't seen
journalctl -u cloudflaredor the tunnel's behaviour.gate --fix,tsc, and the forge-box and wait-alarm tests pass here.What changed
src/system/tunnel_config.tsnow renders a top-leveloriginRequest:block with these settings:connectTimeout: 5stcpKeepAlive: 15snoHappyEyeballs: truekeepAliveConnections: 256keepAliveTimeout: 5mnoHappyEyeballsskips the IPv4/IPv6 race, since the origin is an IPv4 literal.infra/forge-box/cloudflared-forge.ymlis updated to match whatbun scripts/tunnel-config.tswould render. I edited it by hand because that script needs the forge's database.src/maintain/wait_limits.ts(the tunnel row'swhytext) now says the config sets only the connection pool. That bounds a dial, not a response, so the row stays "no forge-held bound".test/forge-box-unit.test.tschecks that the block is rendered and comes beforeingress:.Not done
/etc/forge/cloudflared.ymland restart cloudflared once production settles.To try it
bun test test/forge-box-unit.test.ts./healthzfirst-byte time against the 3957 ms measured.🤖 Generated with Claude Code
Closes #14261