Skip to content

perf: read workload statuses one prefix per app, entrypoint and node - #751

Open
CMGS wants to merge 1 commit into
masterfrom
perf/status-prefix
Open

perf: read workload statuses one prefix per app, entrypoint and node#751
CMGS wants to merge 1 commit into
masterfrom
perf/status-prefix

Conversation

@CMGS

@CMGS CMGS commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

bindWorkloadsAdditions fetched every workload's status with its own GetOne, so a listing of N workloads paid N status round trips on top of the meta and node reads. Workloads that share an appname, entrypoint and node share a status key prefix, so one GetPrefix per group replaces them: N*M reads become M for M nodes. Groups read concurrently under an errgroup capped at 32.

Lane A/B (test cluster, release v0.1.5 vs this branch, eru-cli workload list --pod test and eru-cli workload get <all ids>, 3 rounds interleaved with the order rotated, medians of 24 timed calls per arm):

workloads groups list v0.1.5 list this get-all v0.1.5 get-all this
100 (one containerd node) 1 25 ms 24 ms 23 ms 23 ms
1000 (10 mock nodes) 10 102 ms 83 ms 106 ms 80 ms

One node is a wash because the per-workload reads already ran in parallel under the pool; the gain is the etcd server work proportional to N.

Behaviour that changes:

  • a status read failure now fails GetWorkloads/ListWorkloads instead of leaving StatusMeta nil silently; a missing or unmarshalable status still leaves it nil.
  • a single-ID GetWorkload reads the status blobs of its whole app/entrypoint/node group (one round trip as before, more bytes).

Gates: build, vet, full tests, lint, fmt-check, asl on linux and darwin green; comments +1 (the prefix's trailing slash).

bindWorkloadsAdditions fetched every workload's status with its own
GetOne; a listing of N workloads cost N status round trips on top of
the meta and node reads. Workloads sharing an appname, entrypoint and
node share a status key prefix, so one GetPrefix per group replaces
them: N*M reads become M for M nodes. Groups read concurrently under
an errgroup capped at 32.

A status read failure now fails the call instead of leaving the
status nil silently; a missing or unmarshalable status still leaves
StatusMeta nil.
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.

1 participant