Bookmarks

Chaos engineering

The practice of deliberately injecting failures into a running system to test its resilience and find weak spots before a real outage.

Also: chaos testing

checked 9 Nov

All terms

The idea is simple: it is better to meet a failure in a controlled experiment than during an outage. So failures are deliberately injected into the system — virtual machines are shut down, delays are added to the network, the disk is filled up — and then one watches whether the system keeps serving users and whether the on-call engineers notice what is happening.

How an experiment works

  1. Define a steady state — a metric that shows the system is healthy: for example, a share of successful responses above 99.9% or a median latency of no more than 200 ms.
  2. State a hypothesis: the steady state will hold because replication, a load balancer or an automatic restart will kick in.
  3. Inject a realistic failure: a server outage, a dropped connection, a delayed response from a dependency, a disk running out of space.
  4. Compare the metrics against the hypothesis; a divergence reveals a weak spot — fix it and repeat the experiment.
  5. Limit the blast radius: start with a single pod or a small share of traffic and widen the experiment only if the system coped.

Where the term comes from

The practice was born at Netflix: while moving to the AWS cloud, engineers built Chaos Monkey, and in December 2010 the company announced it in a blog post, following up with a fuller description in July 2011 — a program that randomly shuts down virtual machines in production in the middle of the working day, with on-call engineers standing by. This is how teams made sure their services survived failures without visible harm to users, and in 2012 Netflix open-sourced Chaos Monkey. Other “monkeys” of the “Simian Army” followed: Latency Monkey injected delays into service-to-service traffic, Janitor Monkey cleaned up abandoned resources, Chaos Gorilla simulated the failure of a whole availability zone. The approach was generalised in the definition and principles published at principlesofchaos.org: chaos engineering is the discipline of experimenting on a software system in order to build confidence in its ability to withstand turbulent conditions in production.

Tools

ToolWhat it injectsWho maintains
Chaos Monkeyrandomly shuts down virtual machinesNetflix, open source
Chaos Mesh, Litmusexperiments in Kubernetes: pod shutdowns, network failures, disk and CPU stressopen-source community projects
AWS Fault Injection Servicemanaged fault injection into AWS resources and applicationsAWS
toxiproxya proxy that injects delays and cuts connectionsShopify, open source

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • types of load testing

    Load testing and stress testing check how the system copes with growing load in a scenario known in advance; chaos engineering uses unpredictable component failures.

  • SRESite Reliability Engineering

    SRE is the discipline of reliability as a whole: SLOs, on-call duty, incident reviews; chaos engineering is one way to verify that there is a margin of safety.

In depth in the references

where the topic is covered in detail