DocsLatency: the time from a landing to a pod

Latency: the time from a landing to a pod

The owner wants every repository to land and deploy in under a minute (#145). This page measures where the time goes, for the two models of docs/deploying.md: desk rolls its own Deployments with Keel, and it rolls the Deployments of the repositories that name a deploys target. The numbers are of the seven days to 2026-11-11: 145 landings of munhq/desk and 144 of munhq/axon.

docs/runs.md#the-measured-cost-in-seven-repositories-190 gives the cost up to the last step that desk runs. This page adds the end that desk does not record: the pods.

1. The chain

# Step Who does it Recorded in
0 the change reaches main the desk server change_log.landed_at
1 the image is built and pushed a runner, lane runs or base runs of kind image
2 the tag holds the digest a runner, a run of kind promote runs of kind promote
3 the Deployment keeps the digest, or Keel rolls it desk, or Keel runs of kind deploy, or the log of Keel
4 the new pods are ready the kubelet kube_deployment_status_replicas_updated

Step 2 happens only when the image does not push its own tags. Step 3 is one patch with maxUnavailable: 0: one pod goes, the next starts.

2. desk itself, rolled by Keel

145 landings, 73 deployments. Median, the 90th percentile and the worst, in seconds:

Segment Median p90 Max
the agent pushes the change, to the landing 6 20 676
the landing, to the image pushed 11 24 155
the push, to the tag main (it waits for root) 82 145 218
the tag, to the patch of Keel 1 1 38
the patch, to the three pods ready 90 115 179
the landing, to the pods 174 248 324

145 landings made 95 builds of desk-server; 73 of them reached the tag. 22 builds were replaced by a newer landing before root passed, and 50 landings changed no path of the image. Read the table as the changes that deploy, not as every landing.

The build is not the cost of this repository. desk-server builds in 7.6 s, and it does so beside the checks, not after them: the build of a landing starts with the first check (the image has needs: [] up to the promotion). 71 of 101 landings finished the build before root ended, with 50 s to spare. root costs 79 s in the median, and 153 s at the 90th percentile, and the tag waits for it.

desk-ui is the exception: the image step is 64 s in the median, and it pushes main itself, so its roll starts when the build ends and the whole landing is 200 s. Its Turbopack build is a cached Buck2 target now (#244), so the roll of the pool costs it nothing.

The cache of the pool

The runner pool keeps no cache of its own (munhq/desk#244). It was a StatefulSet with a claim of 25Gi for each pod (munhq/k3s-gpu#197) that held the cargo home and target of one repository, the Turbopack cache of desk-ui and the npm tarballs. The builds and the tests of every repository are Buck2 actions on NativeLink now, which every runner and every desk try reads, so a new pod is as fast as an old one, and a landing of desk-ui is a hit in the cache when the console did not change. The claims and their variables (DESK_RUNNER_CARGO_CACHE, DESK_RUNNER_NPM_CACHE, DESK_UI_BUILD_CACHE) are gone. The pool is still a StatefulSet, so a pod keeps its name across a roll.

The double roll

Keel stamps keel.sh/update-time into the pod template, so every patch is a full restart, also when the image did not change. Desk tells Keel of the new digest about 1 s after the promotion, and the poll @every 2m then finds the same digest and patches again:

The two patches of one deployment Count
2 patches 230 of 259
3 patches 22
4 patches 2
1 patch 5

The gap between them is 72 s in the median (2 s to 130 s). Two ReplicaSets 19 s apart run the same digest and differ only in that annotation. The roll costs 90 s instead of about 55 s, and every deployment starts three more pods than it needs. That is half of the last segment of the table above: without the second patch the landing to the pods is about 130 s. munhq/k3s-gpu#311 removes the poll from the namespace desk, where desk is the only source of an image and it tells Keel of every push.

It landed on 2026-11-11 (k3s-gpu log entry 1969): the library chart takes keelTrigger, and the charts of desk and desk-ui set it to none. Argo CD reconciled the change at 17:26, and no Deployment of the namespace carries keel.sh/trigger or keel.sh/pollSchedule any more. The observation that made it necessary is in Keel's own log, on the landing of entry 433: the webhook patched desk-ui at 17:25:01 and started one ReplicaSet, and the poll found the same digest 53 s later, patched the same Deployment and started a second one.

3. axon, rolled by a deploy run of desk

144 landings. The two images of the repository:

Step n Median p90 Max
image axon 86 238 359 517
root 124 231 404 570
image proxium-web 106 110 202 291
deploy proxium-dev-web 40 42 47 902
deploy proxium-dev-api 32 29 41 68

A landing of axon reaches its last step in 271 s in the median. The deploy run is cheap: it pulls the image on the node, patches once and waits for the pods. The cost is the image build.

The deploys target waits for the image of its containers, not for a check. Landing 786 shows both ends:

+0 s    checks and builds start; root ends +256 s, image axon +266 s, proxium-web +103 s
+104 s  deploy proxium-dev-web starts, +144 s the pod is ready
+266 s  deploy proxium-dev-api starts, +292 s the pods are ready
landing 788 (a change of id/** only): proxium-web +53 s, deploy +53 s, ready +89 s

So a change of the web site is live in 89 s, and a change of the Rust code in 292 s. The release compile is the difference.

The release compile runs twice

image axon runs scripts/release.sh, a Buck2 build of //:axon-bin in the profile release. Its log answers the question:

Waiting on root//:axon — rustc rlib [pic]      304 s
Waiting on root//:axon-bin — rustc link [pic]   53 s
Cache hits: 99%
Commands: 1860 (cached: 1858, remote: 2, local: 0)

1858 actions come from the cache and two do not, and those two are the whole build. The check root compiles the same targets in the profile dev (rustc rlib 99 s, 371 actions run on the cache's workers), so a change of the Rust code pays for two compiles of 58k lines of src/, at the same time, on the same three workers.

Both are bimodal:

image axon, 7 days n Median
under 30 s (everything in the cache) 13 12 s
2 to 5 min 52 231 s
over 5 min 20 354 s

The 12 s is the build of a landing whose release targets are in the cache. A check that builds //:axon-bin in release makes every image build that fast: the image step then copies a binary that exists, and the deploy starts 20 s after the landing. That is munhq/axon#554, and the split of the root crate is munhq/axon#528.

proxium-web: the docs rebuild the console

id/Dockerfile has four stages: the static site, the docs, the Next app, and the runtime. It runs on 121 of the 144 landings, because its paths name the root package.json and package-lock.json, which every workspace writes.

The build has the registry cache of BuildKit: run 8408 imports ghcr.io/munhq/proxium-web:buildcache in 1.4 s and 22 steps come back CACHED. What it pays is two builds it does not need, and three installs with no cache. Run 8408 is a change of docs-site/:

Run 8408 Time
npm run build -w proxium-docs, the Docusaurus build 38 s
npm run build -w proxium-id, the Next build 33 s
the runtime layers 11 s
the export of the cache (mode=max) 29 s

The Next build runs again because the builder stage copies public/docs and public/marketing from the other two stages before it runs next build (lines 89 and 91 of id/Dockerfile). A change of one docs page therefore recompiles the console, though next build never reads public/: that folder goes into the runtime image on its own.

The three npm ci have no --mount=type=cache. Run 7045, cold, pays 96 s for the 1596 packages of proxium-docs, 45 s for the 294 of proxium-id and 11 s for the 83 of proxium-site; the root lock and id/package.json moved 9 times in the seven days.

image proxium-web, 7 days n Median
under 30 s (every layer present) 19 11 s
30 to 90 s 24 72 s
90 s to 3 min 43 130 s
over 3 min 20 205 s

Run 8398, a change of id/ only, is 46 s. That is the floor of the current order of the stages.

munhq/axon#555 moved the docs copy out of the builder stage and gave the three installs a cache mount. It landed on 2026-11-11 (axon log entry 791); the first build afterwards was the cold one, 141 s, because every layer of the Dockerfile changed.

The landing after it was a change of docs-site/** (axon issue #556, log entry 792), and it is the answer: image proxium-web took 29 s, and its log shows #35 [builder 10/10] RUN ... npm run build -w proxium-id as CACHED. The only steps that ran were the docs stage, 16.3 s for the check of the 38 pages and the Docusaurus build, and the runtime layers, 8.8 s. A change of one docs page reaches its pod in 64 s.

4. How to measure again

desk runs budget --repo munhq/desk --landings 60     # the median, p90 and max of each step, its wait and its start
desk runs landing 427 --repo munhq/desk --wait       # the loop of one landing
desk runs log <id> --repo munhq/desk                 # the log, with the cache hits of a Buck2 build or the layer of an assembly

start of the budget is the time from the landing to the start of the run, so it shows what a step waits for. The end that desk does not record comes from the cluster:

  • kubectl -n desk get sts desk-runner and kubectl -n desk get pvc -l app.kubernetes.io/name=desk-runner give the pool and the claims; kubectl -n desk exec <pod> -c runner -- du -sh /cache/* gives what each cache holds. The claim of a pod says which pod a warm build has to reach.

  • Keel writes provider.kubernetes: resource updated with name=<deployment> in the namespace keel. Loki holds it.

  • kube_deployment_status_replicas_updated reaches the spec at the end of the roll. Prometheus keeps 6 h; Thanos keeps the older blocks.

  • kubectl -n <ns> get rs <rs> -o jsonpath='{.metadata.creationTimestamp}' gives the exact start of the last rollouts, and revisionHistoryLimit keeps 10 of them.

A rollout is late by up to 15 s in these metrics, because the sample is every 15 s.

5. The target

Fix Effect Issue
one cache entry for the release targets of a Rust repository image axon 238 s to about 20 s munhq/axon#554
the docs and the marketing pages out of the builder stage, and a cache for the three installs image proxium-web 110 s to 29 s, and next build is a cache hit munhq/axon#555, landed
one patch per digest, not two desk 174 s to about 130 s munhq/k3s-gpu#311
the Next build of desk-ui on a claim that outlives the pod desk-ui 64 s to about 40 s #201
the root crate of axon split into crates root 231 s and image axon 238 s, both shorter munhq/axon#528

The whole set is #200. The other cost of desk is root: 79 s in the median, and the tag waits for it. A landing that splits it into a fast step for the paths that changed is #145.

Two of these landed on 2026-11-11: the tags of munhq/k3s-gpu (log entry 1969) and the Dockerfile of proxium-web (axon log entry 791). The image of the release binary is not a cache miss to repair: the check and the image compile the same 58k lines in two profiles, and the two run at the same time. Moving the release build into the check makes the landing wait for it alone, so the choice is one profile for both or the split of the crate — munhq/axon#554 holds the numbers and the decision.

A change of one docs page of the web site now reaches its pod in 64 s, and a change of the console in 89 s. The two landings left in #201 and #554 are the ones that still pay for a build twice.