Chaos Engineering: Breaking Things on Purpose
Design controlled chaos experiments with a measurable hypothesis, bounded blast radius, abort condition, and a clear learning plan.
Chaos engineering tests a specific resilience assumption through a controlled experiment. Define a measurable steady-state signal, choose a realistic failure, limit the blast radius, set an abort condition, and record what the result changes. Start in an isolated test environment; production experiments require explicit authorization and safeguards.
Chaos Engineering: Controlled Experiments for Resilience
Chaos engineering tests whether a system behaves as expected when a plausible failure occurs. It is an experiment with a question, measurable signals, a bounded change, and a way to stop. Randomly terminating services without a hypothesis or recovery plan is fault injection without useful evidence.
The Principles of Chaos Engineering describe defining steady state, introducing realistic variables, testing a hypothesis, and minimizing the blast radius. Their production guidance is a principle for experienced teams, not blanket permission to affect users.
The experiment loop
- Choose a question. Identify an assumption about a dependency or failure mode that matters to a user journey.
- Define steady state. Pick an observable signal such as request success, latency, queue age, or successful fallback behavior. Record its normal range before the experiment.
- Write a hypothesis. State what should remain true under the injected condition and how you will measure it.
- Bound the blast radius. Limit the target service, request path, traffic, environment, and duration. Keep the experiment inside its intended boundary.
- Set an abort condition. Choose a signal and threshold in advance, name who can stop the run, and confirm the kill switch and cleanup path work.
- Inject one variable. Change one failure condition at a time so the result points to something actionable.
- Compare and learn. Compare the observed signal with the baseline, record surprises, assign fixes, and update the hypothesis or runbook.
A first experiment in staging
Illustrative scenario: A service displays a fallback message when its recommendation dependency is slow. The assumption is that the page remains usable when that dependency stalls.
- Hypothesis: With a controlled delay on the recommendation call, the page continues to return its normal response and uses the fallback; the agreed latency and error signals stay within the staging limits.
- Steady-state signals: Track page success, latency, fallback activation, dependency timeouts, and queue depth. Record a baseline using the same synthetic request path before injecting delay.
- Blast limit: Use an isolated staging deployment, a dedicated test account, one endpoint, and a bounded request stream. Keep the experiment away from production credentials, shared data, and unrelated services.
- Abort condition: Stop if the page exceeds the team’s staging error or latency limit, if the delay affects a non-target request, or if cleanup cannot be confirmed. Name an operator who can halt the injection immediately.
- Learning: Confirm that the delay was removed, compare the signals, and record whether the fallback worked. If it did not, fix the dependency timeout or fallback behavior and repeat the experiment before expanding scope.
This is a test plan, not a claim that every application should use the same delay, limit, or tool. Set bounds from the service’s own objectives and verify that the staging environment is isolated before running it.
Guardrails before production
Staging is useful for checking the injection, dashboards, and cleanup path. It cannot prove how the live system behaves under production traffic. A production experiment can provide that evidence, but it can also affect customers. Do not run one without explicit authorization from the system owner, an agreed change window, named responders, and a tested abort and recovery path.
Before a production run, document:
- the owner approving the target and scope;
- the exact resource, request path, or traffic slice in scope;
- the steady-state signal and stop threshold, based on the service’s objective;
- the person who can stop the run and the command or control that will do it;
- the cleanup and recovery steps, including how to verify normal operation;
- the stakeholders to notify and the incident path if the experiment causes unexpected impact.
Begin with a small, reversible change. Avoid starting with region loss, shared database failure, or experiments that can modify or delete user data. Expand only after the earlier run is understood, the fix is deployed where needed, and the system owner has approved the next scope.
What to do with the result
A successful experiment supports only the tested hypothesis, environment, configuration, and time. It does not prove resilience to every failure. A failed hypothesis is useful when it produces a concrete action: change a timeout, cap retries, isolate a queue, improve a fallback, or add a missing signal.
Record the hypothesis, environment, change injected, baseline, observed result, abort events, cleanup confirmation, and follow-up owner. Keep the write-up short enough for an on-call engineer to use later. Update the relevant runbook when the result changes recovery steps.
Related practices
Chaos experiments complement tests that validate expected code paths. They do not replace unit, integration, load, or security testing. For related resilience mechanisms, see Resilience Patterns, API Retries, Timeouts, Backoff, and Circuit Breakers, and Disaster Recovery.
For a practical experiment framework, consult the Principles of Chaos Engineering and the documentation for the fault-injection tool and infrastructure you actually use. Product features and safety controls vary by tool and version; verify them before an experiment.
Category
Related Posts
Incident Response: Detection, Response, and Post-Mortems
Build an effective incident response process: from detection and escalation to resolution and blameless post-mortems that prevent recurrence.
Kubernetes High Availability with HPA, PDBs, and Zones
Plan Kubernetes application availability with HPA, Pod Disruption Budgets, health probes, and zone-aware scheduling for safe maintenance.
Graceful Degradation: Systems That Bend Instead Break
Design systems that maintain core functionality when components fail through fallback strategies, degradation modes, and progressive service levels.