advanced33 min studyLesson 75 in Engineering

Chaos engineering and fault injection

Design bounded failure experiments with explicit hypotheses, independent stop controls, and recovery evidence.

On this page

What you’ll understand

  • Translate a resilience claim into a falsifiable experiment with steady-state observations.
  • Calculate an exposure budget and identify unsafe shared infrastructure.
  • Design abort and recovery verification that remain available during the injected fault.

A fault experiment is useful when it answers a specific question about a system. Randomly killing processes without a hypothesis can create disruption while teaching little. Begin with a claim derived from a failure model: for a named workload, removing one replica should preserve useful responses within stated boundaries. Specify the smallest experiment that can challenge the claim, the observations that would falsify it, and how to stop and restore the system if the expected recovery does not occur.

Inject the fault that challenges the claim

Distinguish the injected cause from the observed symptom. Stopping a process tests crash handling, while delaying responses tests deadlines, cancellation, and queue behavior. Dropping packets can differ from rejecting connections immediately because callers wait and retry differently. Choose a fault whose semantics match a plausible failure mode, then identify which operation path it touches. A container restart does not necessarily test a zone outage, persistent data corruption, or an inaccessible control plane. State those exclusions so a successful experiment is not generalized beyond its evidence.

Establish a representative baseline before injection. Observe correct completed operations, latency distributions, backlog age, error categories, and relevant resource saturation. Include a control cohort when feasible and account for workload changes that could explain the same symptoms. A short experiment with no affected requests provides little evidence. Define a minimum useful sample and a maximum safe exposure before starting; if those requirements conflict, improve the environment or measurement rather than silently relaxing the safety boundary.

Eexposed=λf ΔtE_{\mathrm{exposed}}=\lambda f\,\Delta t
For a constant original-operation rate λ, a fixed fraction f routed to the experimental cohort, and duration Δt, this estimates exposed original operations. It is not a bound on failures if shared dependencies allow impact to escape the cohort.↔ Scroll wide equations horizontally.

Make the stop mechanism independent

Define abort conditions using user outcomes and protective resource limits, not only the injector's status. A concrete test might stop if control-cohort errors rise, recovery queue age exceeds a threshold, or the observer loses visibility. The stop mechanism needs a tested path that does not rely entirely on the failing component. Bound fault duration with a lease or expiry, keep an authorized operator able to intervene, and verify that reverting the injection actually restores the intended system state. A command returning success is not recovery evidence.

Reduce the initial blast radius by using non-production environments that reproduce the relevant mechanism, then carefully selected production cohorts only within the organization's authorized process. Shared databases, credential systems, and network control paths can invalidate cohort isolation. Review them explicitly. Schedule experiments to avoid compounding unrelated maintenance and retain a rollback or containment plan for persistent state changes. Experiments involving irreversible data effects require a different design from temporary latency injection; do not assume an automated stop can undo corruption.

Bplanned=λfe ΔtB_{\mathrm{planned}}=\lambda f e\,\Delta t
Under constant rate, isolated cohort exposure, and an assumed failure fraction e within that cohort, this plans the number of failed original operations. Treat e as a scenario assumption, not as a measured guarantee or permission to exceed an agreed impact limit.↔ Scroll wide equations horizontally.

Measure the recovery, not just the interruption

Continue observation after removing the fault. Watch backlog drain, cache warming, replica catch-up, client retries, and any lingering divergence. A service can return healthy probes while users still wait behind recovery work. Preserve traces and configuration versions so the outcome can be reproduced and explained. If the hypothesis fails, the useful result is an identified mechanism and a concrete correction, followed by a comparable retest. Avoid changing multiple recovery controls at once unless the experiment explicitly studies their interaction.

The replica lab is a planning aid for one narrow invariant. Set n and remove k nodes, then predict when the number up falls below floor(n/2) + 1. Use that threshold to design a process-loss hypothesis, but do not infer consensus correctness, storage durability, or correlated-domain tolerance from the picture. A real experiment must observe the protected operation, its protocol state, and recovery behavior. The lab provides a clear count to challenge; the system provides the evidence.

Plan a limited latency experiment

A fictional read service receives 2,000 original operations/s. An isolated 1% cohort receives injected latency for at most 30 seconds. Plan for 20% of that cohort to miss its deadline, and retain an independent control-cohort abort signal.

  1. The experimental cohort receives 2,000 × 0.01 = 20 original operations/s under the constant-rate assumption.

  2. Maximum planned exposure is 20 × 30 = 600 original operations, excluding retries from the operation count.

  3. At the assumed 20% cohort deadline-miss rate, planned misses are 600 × 0.20 = 120. Any control-cohort impact challenges the isolation assumption and triggers the predefined abort.

The result

The arithmetic sizes one scenario; it does not make 120 failures acceptable automatically. The authorized impact limit, stop latency, and shared dependencies must all be reviewed before the test.

Explore the model

Interactive lab

Interactive lab · reliability

A bounded replica-loss hypothesis

Set replica count n and unavailable count k, then compare the number up with the majority threshold. Use the count to formulate a hypothesis before observing an actual replicated protocol.

A bounded replica-loss hypothesisA replica count and a majority threshold, without a consensus protocol. Playback highlights fixed replica states. Having a majority alone does not establish linearizability, durability or failure independence. Current readings: Available replicas: 4 of 5; Majority needed: 3; Majority available?: Yes. All parameters are adjustable with the labeled controls below.Majority available · need 3 of 5Playback highlights fixed statesR1 · upR2 · upR3 · upR4 · upR5 · downCyan mark: majority threshold
AvailableUnavailableMajority threshold
Available replicas
4 of 5
Majority needed
3
Majority available?
Yes
t = 0 s

A replica count and a majority threshold, without a consensus protocol. Playback highlights fixed replica states. Having a majority alone does not establish linearizability, durability or failure independence. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forRemoving replicas tests a stated failure model; counting a majority does not establish correctness or recovery.

Check your understanding

Which experiment result most clearly falsifies the assumption that a fault is isolated to its test cohort?

Try it yourself

A test receives 3,000 original operations/s and exposes 0.5% for 40 seconds. If the planning scenario assumes 10% cohort failures, calculate exposure and planned failures. Name two observations needed after the fault ends.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Convert the percentage to 0.005 and keep original operations separate from retry attempts.

Compare with the solution

Exposure is 3,000 × 0.005 × 40 = 600 operations; scenario failures are 600 × 0.10 = 60. After the fault ends, observe user-visible latency and correctness as well as backlog age or replica catch-up. Healthy probes alone cannot show that queued users recovered or that state remained consistent.

Take it with you

  • Start from a falsifiable claim and inject the matching failure semantics.
  • Exposure calculations depend on an isolation assumption that must itself be tested.
  • Independent stop controls and post-fault recovery evidence are part of the experiment.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.