§ 84
Chaos Engineering
Resilience that has never been exercised is a hypothesis, and production will test it whether or not you schedule the test.
Keep in mind
Break it on purpose before production does it for you
What to do
Pick one dependency, write down what steady state should look like while it is down, and take it away in production during working hours with an abort switch and someone watching. Start with a small slice of traffic, widen only after the system holds, and do not experiment on a service you already expect to fall over.
Why it happens
Failover paths, retries and redundancy run only when something breaks, so they decay between failures: a config drifts, a dependency is added, a timeout changes, and nobody notices until the real outage. Staging cannot reproduce production's traffic, data and coupling, so a test there tells you less than you would hope about the system people actually use. Injecting failure on purpose, in production, against a stated hypothesis about steady-state behavior, makes those weaknesses show up on a weekday afternoon with engineers watching instead of at 3 a.m. Netflix built Chaos Monkey early in its move to AWS to kill instances at random, so every service had to survive losing one.
In practice
In late September 2014, AWS rebooted about a tenth of its EC2 fleet on short notice to patch a Xen vulnerability. Of Netflix's 2,700+ production Cassandra nodes, 218 were rebooted and 22 did not come back, yet Netflix reported zero downtime that weekend. The team credited the Chaos Monkey runs against Cassandra it had started a year earlier, which had forced it to build the automation that detected and replaced the failed nodes.
Read the accountWhen it stops applying
First, Do No Harm: deliberately degrading a system real customers depend on spends their trust, and much of the same knowledge comes cheaper from fault-injection tests, game days and design review; on a system already known to be fragile an experiment only confirms what you knew, so fix it first.
Source
Principles of Chaos Engineering (principlesofchaos.org, last updated March 2019) — the definition, the steady-state hypothesis, running experiments in production and minimizing blast radius; Netflix Technology Blog, 5 Lessons We've Learned Using AWS (2010) — the introduction of Chaos Monkey.
Read the sourceCite this
Hammurabi, § 84, “Chaos Engineering.” https://kanywst.github.io/hammurabi/laws/chaos-engineering/
BibTeX
@misc{hammurabi-chaos-engineering,
title = {Chaos Engineering},
author = {{Hammurabi contributors}},
note = {Hammurabi, § 84},
url = {https://kanywst.github.io/hammurabi/laws/chaos-engineering/}
}Read in a column
Related laws
- 28Murphy's LawGiven enough time and traffic, a failure mode that can happen eventually will.
- 47Fallacies of Distributed ComputingNetworked code quietly assumes eight things about the network that are false in production.
- 79Avoid FallbackA fallback path runs only after something has already failed, so the least-tested code in the system runs under the worst conditions.
- 95Pesticide ParadoxEvery way of finding bugs leaves behind the bugs it cannot find, so a test suite that never changes finds fewer and fewer.