#76 - Chaos Engineering Explained: Part 1
A stateless service can still go down when its only replica disappears.
16 min read
Chaos engineering—is it really chaos, or something more structured? Andrey, Paulina, and Mattias talk about what chaos engineering means, how it started, and why you might already be using it unintentionally.
The name is the worst thing about chaos engineering
You want to know whether your system survives losing a node, an availability zone or a database primary. If your answer is an untested recovery document, you don’t yet know. A controlled failure test gives you evidence that your documented recovery path works under the conditions you test. The discipline for that is called chaos engineering, and the name does it no favours.
“Chaos” suggests things falling over at random, and the misconception that follows is that this is reckless, something you should not be doing at all. We’d say it’s the other way round. Chaos is what you have when things go down on their own and nobody is watching. Chaos engineering is the structured way of taking them down: a sentence you wrote beforehand, one fault injected on purpose, a measurement, and a limit on how far the damage can travel. It’s closer to a controlled trial than to a monkey loose in the data center.
The other surprise is how close you already are. If you run anything on EC2 Spot instances, or on Kubernetes nodes that come and go, you have been running these experiments for years without putting the label on them. The gap between you and a team that does chaos engineering on purpose is smaller than the vocabulary suggests, and the readiness bar is the part that actually stops people.
Where the monkey came from
The reputation comes from one specific tool, and knowing which one explains both the fear and the method.
Why is it called chaos if the practice is structured?
Because the first well-known tool picked its victims at random, inside a window that was anything but random.
Netflix described Chaos Monkey in The Netflix Simian Army in July 2011: a tool that randomly disables production instances, so the team could be sure they survive that common failure without customer impact. The same post is explicit about the conditions. It ran in the middle of a business day, in a carefully monitored environment, with engineers standing by. Random targets bought them real failures to learn from. The business hours bought them people awake to watch.
The zoo grew from there. Latency Monkey added artificial delays between services, and Chaos Gorilla took out a whole simulated availability zone. Larger engineering organizations picked up the idea, and eventually the cloud providers built their own: AWS launched Fault Injection Simulator on 16 March 2021, since renamed Fault Injection Service, with preconfigured experiments and stop conditions built in. The original Chaos Monkey is still on GitHub, tied to Spinnaker.
You have probably run experiments already
None of that history is a prerequisite. Your cost optimization work may have handed you the first experiment for free.
What counts as an experiment you already run?
Any mechanism that takes capacity away on someone else’s schedule and makes your system prove it can cope.
Spot capacity gets reclaimed when EC2 wants it back. The interruption notice arrives in the instance metadata, and it is a best-effort two-minute warning only when the interruption behavior is stop or terminate. Set the behavior to hibernate and there is no advance window at all: hibernation begins as the notice is issued. You may also get an earlier rebalance recommendation warning that interruption risk is elevated. From there it’s on you to reschedule whatever was running. One correction to the mental model many of us still carry: the old bidding war, where a higher bidder pulls the instance out from under you, went away in November 2017. AWS changed the pricing model so prices move gradually with supply and demand, and instances are reclaimed on capacity, not on someone outbidding you. The interruption behavior your system has to handle is identical either way.
If you run Kubernetes, there is tooling for exactly this. The AWS Node Termination Handler watches for the interruption signal, cordons the node so nothing new lands on it, and evicts the pods so the scheduler can place them elsewhere. That is an attempted recovery, not a guarantee. The eviction has to finish and the replacement pods have to become ready inside whatever time the notice buys you, and the notice is not promised to arrive: the instance can be terminated before it shows up. Whether the sequence actually completes is something to verify under load, with traffic on the node while it drains.
You don’t need containers either. An Auto Scaling group with a launch template and several instance types will replace a reclaimed instance, possibly in another availability zone where capacity is cheaper.
Immutable infrastructure comes first
Spot works as a test because the instances are disposable. That property is the thing to build before you start taking anything away deliberately.
Why does immutable infrastructure come before experiments?
Because an experiment against servers you’re afraid to replace produces an outage with no recovery path, not a finding.
For customers running EC2, we rebuild the images with Packer every week and replace the running instances with fresh ones. The goal there is patching, an automated way to roll out updates in immutable mode. Drift accumulated during the week goes out with the old instance.
The alternative is the estate most of us have met. Servers configured by hand over years, each one slightly different, each one a thing people are afraid to touch. When one of those goes down there’s no recourse, because nobody knows how it came to be the way it is. A team in that position should not be running chaos experiments. It should be making its servers replaceable.
Every experiment starts with a hypothesis
Once replacement is automatic, the question stops being whether you survive and starts being what exactly you believe.
What does a chaos experiment actually test?
A sentence you wrote down first, such as “we stay up if one of our three availability zones goes away”, and the experiment exists to disprove it.
That framing is the whole discipline. Principles of Chaos Engineering defines the steady state as a measurable output of the system, throughput, error rates, latency percentiles, and treats an experiment as a search for a difference between a control group and the group you broke. You might well be wrong, which is the point of asking: run it somewhere safe, and you may find the second availability zone was carrying something you forgot about.
The availability zone case is the easiest place to start, because most infrastructure is already supposed to handle it. AWS FIS ships it as a scenario, bigger than its name. AZ Availability: Power Interruption stops the EC2 instances in one zone, blocks the API calls that would provision replacement capacity so Auto Scaling, EKS and ECS cannot scale back into it, fails over a multi-AZ RDS writer, interrupts the ElastiCache replication group and leaves an EBS volume unresponsive. The default is 30 minutes of interruption plus another 30 minutes of recovery symptoms, and it ships with no stop conditions of its own. The two-minute piece is one action inside it: aws:network:disrupt-connectivity blocks connectivity for the subnets in the zone, which approximates traffic dropped while DNS updates. You can watch it from the VPC side, as rules appear denying traffic in the zone and then go away again.
Faults don’t have to be infrastructure-shaped. At the request layer, Envoy’s fault filter returns a configured status code for a share of requests, which is how Istio’s fault injection exposes abort with an httpStatus and a percentage. Hand a third of your callers an HTTP 500 and you test what the caller does next: its retries, its backoff, its circuit breaker, its fallback path. Killing pods exercises part of that path too, through the connection failures and resets that Envoy’s router retries on. What it can’t reproduce reliably is a chosen status code on a chosen share of requests, which is what the fault filter is for. One limitation to design around: Istio does not support fault injection and retry or timeout policies on the same VirtualService, so the retries quietly stop applying. Istio’s own workaround is to inject the fault on the upstream proxy with an EnvoyFilter, which leaves the retry policy on the client proxy. Scoping the experiment to recovery the application does itself also works.
Stateless isn’t the same as safe
The first instinct, when picking what to break, is to sort workloads by whether they hold state. It’s a reasonable instinct and it hides the common failure.
Is a stateless service safe to kill?
Only if the rest of the configuration agrees with you, and that’s the assumption worth testing.
This is where we disagree. Mattias draws the line at state: stateless replicas can be killed all day, a new one comes up, you always have a decent number running, and it’s the database primary that takes bravery. Andrey’s answer is that “stateless” is itself a hypothesis. The term is narrower than it sounds. In the twelve-factor sense, the process keeps nothing in memory or on local disk that has to survive a restart, and anything that must persist goes to a backing service. A Kubernetes Deployment with one replica and no autoscaling clears that bar and is still a single point of failure, and killing that one pod takes the service down exactly as hard as killing a database would.
One from our own week: a service throwing intermittent 500s, with developers reading ELB logs, application logs and Envoy logs looking for the cause. The answer was in the resource configuration, once someone looked there. The task ran on Fargate at 0.25 vCPU, with a CPU-based scaling policy set to scale out at 75%. ECS measures that percentage against what the task definition reserves rather than against the host: service CPU utilization compares the CPU used by the service’s tasks with the CPU the task definition specifies. So the threshold sat at 75% of a quarter of a vCPU, and on that service, by the time it was reached the task was already unresponsive. That is one workload’s behavior, not a rule about Fargate sizing. The system was supposed to scale, and it was sized so that the scaling arrived too late to help. A load test against that service, with the scaling policy watched rather than assumed, is the kind of thing that brings the problem out.
Load tests and failures belong in the same run
That example only shows up under traffic, which is the problem with testing in a quiet environment.
Why combine a load test with a failure?
Because a service that comes back fine with nothing talking to it tells you almost nothing about the same service carrying production load.
Kill a pod in a staging environment with no traffic and it restarts. Green. You have shown that the restart works, and nothing about recovery under load, because there was nothing to disrupt. Run a load test first and start removing nodes while it’s going, and the picture changes: requests queue behind rescheduling, retries pile onto the replicas that are left, and latency goes somewhere you can measure.
Be honest about what this does not settle. Development and staging environments run on smaller instances and get scaled down for cost, especially for larger systems, so the numbers won’t transfer to production. You won’t have the same traffic, the same data or the same load, even with identical code deployed. Failure modes stand a better chance of transferring: the retry storm, the single replica, the misconfigured threshold. Check before you carry one across. Compare the replica counts, instance types, scaling thresholds and timeouts on both sides, and where they differ, treat the finding as a finding about staging until you have tested it where it matters.
Knowing when you’re ready
All of this assumes an experiment would teach you something you don’t already know, which is a higher bar than it sounds.
How do you know you’re ready?
When you’ve run out of problems that are visible without looking for them.
From the consulting side, most organizations aren’t there. We rarely see chaos engineering practiced deliberately and named as such. What we do see, often, is the shape of it: Auto Scaling groups, Spot capacity, golden images, systems built so they heal when a piece disappears. Where teams do run explicit experiments, it tends to be narrow, one part of the system, one scheduled trigger, one environment, rather than anything resembling Netflix in production.
There’s an analogy with observability worth borrowing here. We’d put tracing in a similar position: valuable, but difficult to introduce, so it tends to land last if it lands at all. Chaos testing sits in the same spot among test types, and that’s the argument for not reaching for it before the cheaper tests. The checklist before you start is short and unglamorous: monitoring that works, management who know you’re doing this, some automated incident response, post mortems you actually write. Get those, then go looking for hidden failure modes.
Make the audit pay for the experiment
Maturity isn’t the only thing in the way. Time is, and time has to be justified to someone who isn’t an engineer.
How do you get the time approved?
Attach it to the disaster recovery evidence you already owe an auditor.
SOC 2 is the usual example, with one qualification worth getting right: it’s an attestation examination, not a certification, and which criteria apply depends on the trust services categories the engagement covers. Availability is one of the optional ones. Where it is in scope, criterion A1.3 in the AICPA’s Trust Services Criteria says the entity tests recovery plan procedures supporting system recovery to meet its objectives. It doesn’t say how. A tabletop exercise and a write-up can satisfy it, and so can a fault simulation you can run on demand. The same hours spent on the second one produce a dated result, repeatable, with the recovery demonstrated rather than described, and that is the version you can point at when you ask the business for the time.
Starting small is allowed, and it’s what we’d suggest. Run a game day: pick one scenario, book a date, prepare the incident in advance, and work through it with the team on a development or scratch environment rather than production. AWS’s Well-Architected guidance puts regular game days in the reliability pillar for the same reason, and lists documenting procedures without ever exercising them as the anti-pattern. Go component by component after that: servers, then databases, then the network. You don’t have to cover the whole system from the start.
What this means for teams
Chaos engineering comes down to a habit: write down what you believe about your system, then check whether it holds. The prerequisites are the same things that make operations bearable anyway: replaceable servers, automatic replacement, monitoring good enough to see the result.
Four things you can do this week:
- Write one hypothesis with a steady state in it. “The checkout service survives losing 50% of its pods” sets the size of the fault but leaves “survives” undefined, so nothing can disprove it. A testable version, with your own numbers in place of these: at 200 requests per second, killing half the checkout pods keeps HTTP 5xx under 1% and p99 latency under 800 ms for the ten minutes that follow. Fault, load, measurement, threshold, duration.
- Grep your manifests for
replicas: 1and check every ECS or Fargate task’s CPU allocation against the threshold its scaling policy uses. These are two ways a system that looks elastic isn’t. - If you run Spot anywhere, exercise the interruption path with the signal it actually uses. Terminating an instance by hand skips the Spot metadata notice, so your handler may never see the event you think you’re testing. FIS sends real Spot interruptions with the
aws:ec2:send-spot-instance-interruptionsaction, rebalance recommendation and two-minute notice included. Run it and watch where the pods land. If you don’t run Spot, moving one non-critical service onto it buys you a continuous experiment and a smaller bill. - Book two hours for a game day on a non-production environment, with one prepared scenario and the people who would handle it for real.
Common questions, answered
How do I run a chaos experiment without taking down customers?
Limit the blast radius before you start: one service, one zone, a short duration, and a stop condition that aborts the experiment automatically when an alarm fires. AWS FIS has stop conditions built into the experiment template. Running against a lower environment first reduces customer exposure, provided its targets and their dependencies are isolated from production. A staging service pointed at a production database is not.
Pick a fault whose recovery path you can already describe. If you can’t say what’s supposed to happen when the node disappears, you’re not running an experiment, you’re causing an incident. Have the people who would respond in the room.
Can a chaos experiment count as disaster recovery evidence for SOC 2?
Yes, where Availability is in scope for the engagement and you keep dated results showing the recovery procedures ran and met their objectives, which is what criterion A1.3 asks for. SOC 2 is an attestation examination whose scope is agreed in advance, so the availability criteria don’t apply to every report.
An automated fault simulation gives an auditor a demonstrated recovery rather than an asserted one. Check which categories your engagement covers, and keep the output: what you injected, when, what the system did, how long it took to come back.
What’s a game day and how do I run the first one?
A game day is a scheduled exercise where you trigger a prepared incident and work through it as a team, usually on a development or test environment rather than production. Pick one scenario, book a couple of hours, and tell everyone involved in advance.
Keep the first one narrow. Kill one component, follow your own runbook, and write down every place the runbook was wrong. That list is the output. Nobody passes or fails a game day.
Related episodes
- #73 Incident Response: Key Preparations You Need: the preparation that decides how an incident goes, including why rehearsals beat documents.
- #37 Surviving AWS outage (revised for 2021): the availability zone and region failure modes a chaos experiment is trying to reproduce.
- #30 Three pillars of observability: the signals you need in place before an experiment can tell you anything.
- #12 Scale vs Scaling: autoscaling prerequisites and why CPU is the metric you get rather than the one you want.
Resources
- The Netflix Simian Army: the 2011 post that introduced Chaos Monkey and the conditions it ran under.
- Principles of Chaos Engineering: the definition of steady state and the experiment structure, in about a page.
- AWS Fault Injection Simulator general availability: dates the managed service to 16 March 2021 and lists what it launched with.
- AZ Availability: Power Interruption: every fault the AWS availability zone scenario injects, each one’s duration, and the limitations.
- Spot Instance interruption notices: what warning you get before a reclaim, and the hibernate case that gets none.
- New Amazon EC2 Spot pricing: settles that Spot stopped being an auction in November 2017.
- AWS Node Termination Handler: cordons and drains Kubernetes nodes on interruption, maintenance and scale-in events.
- AICPA Trust Services Criteria: the source text for the availability criteria a SOC 2 report covers when Availability is in scope, A1.3 included.
Since we recorded
We picked this up two weeks later in #77 Chaos Engineering Explained: Part 2, which moves on to the tooling and what running an experiment looks like in practice. The managed tooling has moved toward partial failures rather than clean outages: AWS FIS added AZ: Application Slowdown and Cross-AZ: Traffic Slowdown scenarios in November 2025, aimed at the gray failures that are harder to detect than something simply being gone. A Direct Connect action followed in December 2025, which disrupts BGP sessions to test hybrid network failover. Neither changes the order of work: write the hypothesis first, and make the infrastructure replaceable before you start taking it away.
