Skip to content

Distributed Load-Test Architecture: Controllers, Workers, and Result Flow

Design distributed load tests around controller coordination, worker health, clock context, partitions, backpressure, and result aggregation.

Controller, four workers with result buffers and an aggregator, where one worker loses its heartbeat, the aggregator reports 3 of 4 shards incomplete, and offered load drops below plan

Distributed load testing adds a system around the system under test. A controller assigns work, workers generate traffic, and a result path aggregates evidence. Each boundary can distort the workload or the report. A worker can saturate before the target, a partition can remove a shard, clocks can mislead timelines, and an aggregator can fall behind while the run appears active.

Design the test architecture as part of the experiment. State which component owns scheduling, traffic generation, credentials, data, telemetry, and shutdown. Then prove the boundaries with a small run before applying meaningful pressure.

Separate responsibilities

The controller should coordinate configuration and lifecycle. It should not be the only place where samples are measured. Workers should apply the assigned workload and report health. The result path should preserve labels and enough context to explain partial runs. Keep these roles explicit so one component’s queue does not look like target latency.

Define the assignment unit: scenario, actor range, shard, or time window. Record the intended and actual assignment. If one worker is missing, the result should say so rather than silently redistributing work and changing the traffic shape.

The microservices guide covers why worker health and boundary observability matter when traffic crosses several services. The same discipline applies to the test system itself.

Synchronize start and pacing carefully

A simultaneous start is not always realistic, because a barrier can create a connection or cache storm. A loose start makes a ramp less precise. Choose the behavior on purpose and measure when each worker begins applying work. If clocks differ, use a shared run identity and relative phases instead of trusting local timestamps as one global clock.

Pacing belongs to the workload owner. Do not let controller retries or result uploads compete with worker scheduling. Set bounded queues and timeouts, and report when a worker misses its arrival deadline. A run that sends less traffic than intended should be marked incomplete.

Use a small canary worker to validate target access and labels before all workers begin. This catches a bad route or credential without producing a partial distributed result that is difficult to interpret.

Keep worker health first-class

Monitor CPU, memory, network, open connections, file descriptors, event-loop or thread pressure, and error logs on each worker. Compare intended rate with actual rate. A worker at its ceiling can send less traffic than planned and still return a tidy summary.

Use heterogeneous worker sizes only when the model accounts for them. Otherwise one slow shard can alter timing and another can carry more work. Record worker version, location, runtime, and configuration so a later comparison knows whether the driver changed.

Treat worker failure as a test outcome. Decide whether to stop, preserve partial evidence, or replace the shard. Automatic replacement helps in a resilience test and misleads in a capacity test. Make the policy visible before the run starts.

Plan for partitions and backpressure

The result path is a dependency. If it is slow, workers need bounded buffers and a defined behavior: block, sample, spill locally, or stop. Unbounded buffering swaps a reporting problem for a worker failure. Measure queue depth and upload delay separately from target timing.

Exercise a controlled result-path slowdown only when the question includes it. Confirm that a partition is detected, workers do not continue indefinitely with unknown delivery, and partial artifacts identify the missing interval. A clean target chart is not enough if half the samples never arrived.

Keep control messages idempotent. A retry should not start the same shard twice or apply a configuration twice. Give commands a run and shard identity, and log bounded lifecycle events without credentials.

Aggregate without flattening meaning

Aggregate by operation, worker, scenario phase, status, assertion, and time window before producing a top-level summary. Preserve counts of intended, sent, received, and accepted samples. A single percentile over samples from different phases can hide a ramp boundary or a failed worker.

Define whether a percentile is computed centrally from raw observations or from worker summaries. Approximate aggregation can be useful, but its method and limitations should be stated. Do not compare two runs that changed aggregation semantics without calling it out.

Retain worker health beside target metrics. If one worker’s network path had high latency, a global p95 may reflect the generator. If the target was under-sampled during a partition, a better average does not mean it recovered.

Handle data and identity

Distribute fixtures deliberately. A shared read-only dataset may be safe. Mutable records need ownership and cleanup. Ensure each worker can obtain the values it needs without duplicating setup or leaking one actor’s state. Correlated IDs and tokens should have clear scope and redacted diagnostics.

Private or regulated targets may require workers to run in an approved network. The private generation guide covers network-boundary decisions. Record location and route as test metadata so a result is not generalized across paths that were never exercised.

Make shutdown complete

Add a lifecycle checklist to the distributed run. Before pressure begins, verify controller-to-worker connectivity, configuration parity, data availability, clock assumptions, and the expected shard count. During the run, observe worker health and backpressure separately from target results. At stop, verify that workers finish or cancel their in-flight work, partial artifacts are flushed, and the controller records the final state. Reconcile the expected shard count with received samples before calculating a percentile. If one worker disappears, the report should say whether the run is incomplete rather than presenting a confident aggregate. Keep the failure policy explicit. A worker loss may fail the run, reduce coverage or trigger a bounded retry, but it must never be hidden. This detail belongs in the architecture: a distributed test that cannot explain its lifecycle cannot tell target behavior from generator failure.

Stopping a distributed run means stopping new work, draining or bounding in-flight work, flushing result buffers, and releasing workers. Test normal completion, cancellation, worker loss, and controller loss separately. Preserve the final lifecycle state and any partial artifact.

Don’t let a shutdown report success only because the controller process exited. The target may still receive traffic and workers may still hold connections. A graceful policy should be observable in worker logs and result metadata.

Run a small rehearsal that intentionally removes one worker and slows result collection. Confirm that the controller reports the missing shard, the remaining workers follow the declared policy, and partial output identifies what was delivered. Then repeat with normal collection and compare target timing. The rehearsal tests the test architecture itself, so a clean-looking summary cannot hide incomplete pressure.

Make the rehearsal safe and bounded: use a permitted target, a short duration, synthetic data, and an explicit stop condition. Preserve controller and worker logs with secrets redacted. You are checking lifecycle and evidence flow, not how much disruption the result pipeline can take.

When reviewing the final report, reconcile the intended shard count with samples and lifecycle events. A complete-looking percentile cannot compensate for a missing shard. Keep the reconciliation beside the result so later comparisons can distinguish a target improvement from a change in distributed coverage.

The same discipline applies when the worker count changes between runs. Ten workers at fifty users each and five workers at a hundred users each produce the same nominal load, but they differ in connection count, source addresses, per-worker CPU headroom, and how evenly a load balancer spreads the traffic. Record the worker layout as part of the test definition, not as an incidental detail of the environment. When a later run looks faster or slower, check whether the layout moved before you credit or blame the application.