Skip to content

fix(loadtest): generate the large deploy body per iteration and cap its concurrency - #1381

Merged
TheMeinerLP merged 10 commits into
mainfrom
fix/loadtest-large-body-per-iteration
Nov 28, 2026
Merged

TheMeinerLP merged 10 commits into
mainfrom
fix/loadtest-large-body-per-iteration

Conversation

@TheMeinerLP

Copy link
Copy Markdown

Description

The deploy scenario was meant to send a 200 MB artifact, but k6 cannot stream a request body. Every virtual user kept its own full copy of each body, so a busy deploy step would exhaust the memory of the load generator pod long before it said anything about Ingot. The pod also had no memory limit, so the failure would show up as a node under pressure rather than as a clear error.

Following the amended design D10 of add-load-tests (#1380):

  • every deploy body is generated inside its iteration and dropped afterwards, so at most one body exists per request in flight
  • the 200 MB size runs in its own executor whose virtual users are capped, and the cap is derived from the memory limit the load generator pod now gets
  • a run with a --deploy-cap override that would not fit is refused before anything touches the cluster, with a message naming the cap and the limit
  • body generation happens before the request, so the measured request duration and the verdicts stay unaffected

The memory limit (2Gi) and headroom (512Mi) are provisional and give a cap of 7. They are replaced with the measured peak after a run on the cluster (task 9.10).

Type of change

  • fix - bug fix

How was this tested?

  • npm run typecheck in loadtest/: passes
  • npm test in loadtest/: 363 tests, all pass; each new test was seen failing before its fix
  • not yet run against the cluster; that measurement is task 9.10 and follows this PR

Checklist

  • Commit messages follow the Conventional Commits convention documented in CLAUDE.md (English, imperative, one of feat, fix, docs, refactor, test, build, ci, chore, perf)
  • Tests cover the change, or the change is not testable and I explained why above
  • ./gradlew build passes locally (not applicable, loadtest/ only)
  • Documentation and configuration samples are updated if the change is user-facing
  • Existing copyright headers are preserved; new files carry the appropriate header
  • No credentials, tokens or personal data are included in the diff

The 200 MB deploy runs in its own executor whose concurrency is capped
by the memory of the load generator pod. The cap is the largest whole
number whose bodies and headroom fit that limit, and an override over
the rule must be refused with a message that names both numbers. The
tests come first, so they are seen failing before the module exists.
The 200 MB deploy holds one body per in-flight request, so the number
of requests that may run at once has to fit the memory of the load
generator pod. The cap is derived from that limit, and an override that
breaks the rule is refused before a run starts.
The load generator pod is sized from two constants: its memory limit
and the headroom the runtime needs next to the bodies. The tests check
that both are Kubernetes quantities, that the headroom lies below the
limit, and that the TestRun requests and limits exactly that memory, so
a typo cannot reach the cluster.
The 200 MB bodies are held in the memory of the load generator pod, and
without a limit the pod can take the memory of its node. The limit and
the headroom beside the bodies are constants, provisional until a
measured run replaces them, and the TestRun requests exactly the limit
so the pod is not scheduled into memory it cannot have.
A virtual user that keeps the 200 MB body holds a full copy of it, and
every virtual user runs its own runtime, so the copies multiply with
the concurrency. The tests require a pure sender that generates the
body right before the request, from the seed of its size, and generates
it again on the next call, so nothing keeps it between iterations.
The module-level map kept one body per size in every virtual user, so
each virtual user that deployed held its own 200 MB copy. The body is
now generated for each deploy, handed to the request and dropped when
the iteration returns, which keeps the bodies in memory at one per
request in flight. The seed of a size is unchanged, so the bytes stay
the same across runs.
Every size of the deploy shared one executor, so the 200 MB bodies in
flight were not bounded by the memory of the load generator pod. The
tests require the 200 MB size in a separate constant-arrival-rate
executor capped at the derived cap, the other sizes in theirs, and the
rate of the profile split between the two without change.
All sizes of the deploy shared one executor, so the bodies of the
largest size in flight were bounded by nothing but the virtual user
pool. The 200 MB size now runs in a constant-arrival-rate executor
whose maxVUs is the cap derived from the memory of the load generator
pod, and the other sizes keep theirs. The arrival rate is split between
the two, so the load of the profile stays the same.
A cap that needs more memory than the load generator pod has would be
found out only when the 200 MB bodies are already in memory, after the
install and the wait. The test requires the run to stop before the
install and before any cluster call, and the refusal to name the cap
and the memory limit.
A run whose cap breaks the memory rule is now refused before the
install and before any cluster call. The runner checks the cap before
it writes the credentials file, so a refused run leaves no secret
behind. The override of the cap is read from --deploy-cap and passed to
the archive as LOADTEST_DEPLOY_CAP, so the executor that runs the 200
MB size is capped at the value that was checked.
@TheMeinerLP
TheMeinerLP added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit 8e46751 Nov 28, 2026
39 checks passed
@TheMeinerLP
TheMeinerLP deleted the fix/loadtest-large-body-per-iteration branch November 28, 2026 20:26
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