On rebooting: the unreasonable effectiveness of turning computers off and on again
Restarting misbehaving computers and programs is framed as a principled technique rather than a hack. The author models systems as starting from a fixed initial state, running through a well-tested initialization sequence into working states, and occasionally falling into unexpected broken states. Because the initialization path is exercised heavily during development and operation, returning to the initial state and re-running it is argued to be the most reliable repair strategy, aligning with crash-only and recovery-oriented computing. The essay then explores where this story becomes more complex, including layers of abstraction, interactions between components, system-wide equilibria, and the tradeoff between quick repair and gathering evidence for future fixes. A parable about strict versus permissive error handling supports the idea that crashing early and loudly often produces better software.
Reading notes#
- Users routinely fix computer problems by power cycling machines or restarting programs, often without understanding why this helps.
- Technically sophisticated engineers may feel uneasy that this simple restart trick remains necessary even in large, professionally engineered systems.
- The author claims that returning a stateful system to its initial state and re-running initialization is a deeply principled repair method.
- Before execution, a system sits in a fixed initial state and then follows an initialization sequence through several intermediate states into a useful working state.
- This initialization sequence is executed many times in development, testing, and production, which tends to make its state transitions cumulatively reliable.
- When a system runs normally, it moves among a set of well-behaved working states reachable from the initial working state.
- Encountering a defect causes the system to leave the working-state region and enter an unexpected broken state outside the designed behavior.
- Attempts to move directly from a broken state back to a working state are characterized as improvisational and undesirable in reliable engineering.
- The recommended response to a broken state is to turn the system off and on again, leveraging the trusted initialization path rather than ad hoc recovery.
- This perspective underlies ideas in crash-only software and recovery-oriented computing.
- The initial argument glosses over granularity differences between rebooting an entire computer and restarting a single program.
- Restarting one program may not clear problematic state elsewhere; conversely, some issues can persist even after a full system reboot, such as corrupted executables or severe hardware faults.
- In practice, engineers reset systems at various abstraction layers, trying to discard compartmentalized bad state and replace it with known good start state.
- The author notes an analogy to biological systems, where compartmentalized cells are programmed to die and are sometimes destroyed by the body when they misbehave.
- Resetting only one component of a system can be insufficient and may even worsen overall behavior.
- An example is given where a process P runs heavy startup queries, has a defect likely to trigger soon after startup, and crashes via assertions when the defect occurs.
- Under defect-triggering conditions, P can enter a crash loop where each restart sends more startup queries to a shared backend.
- Because these queries are rare during normal operation, the backend may not be provisioned for this load and can be overwhelmed, especially with many replicas of P.
- This can push the overall system into a new operating regime where constant restart queries keep the backend overloaded, turning a local bug into a global outage.
- Even after fixing the immediate crashing defect, the system may remain in a metastable failure mode where retry traffic sustains the overload.
- Possible mitigations for such scenarios include adding randomized delay before restart, using circuit breakers for query load, or caching startup results across restarts.
- The broader point is that restarting parts of the system is not a universal solution for reliability issues and must be considered in system-wide context.
- The author suggests crashiness can contribute to reliability, but engineers must reason carefully about the consequences of crashes.
- The earlier discussion centers on repair, but long-term system evolution also requires understanding root causes of failures.
- Ideally, systems are designed for observability so they emit enough durable evidence to reconstruct what happened and locate defects.
- In real deployments, available data is often incomplete, and engineers may need to balance urgent repair against time spent collecting forensic information before rebooting.
- The author proposes a research challenge: low-overhead instrumentation for multi-process and multi-machine distributed systems that enables post hoc reconstruction of state at arbitrary times in production.
- The rr debugger is cited as impressive existing work, but not yet suitable for running all production workloads or multi-tier architectures.
- A parable describes a student, Mike, who wonders whether functions should be strict and crash on violated preconditions or permissive and attempt to repair invalid inputs.
- Mike implements two Unix shells, one in a strict, crashing style and another in a permissive, error-tolerant style.
- Using the strict shell as his login shell causes full logout on crashes, which is very inconvenient but exposes defects clearly.
- Because failures are obvious, Mike can find and fix bugs rapidly, eventually making the strict shell stable and useful.
- The permissive shell also contains defects, but its willingness to continue despite bad inputs makes problems harder to locate and correct.
- Mike is unable to fix enough issues in the permissive shell to make it practical, and eventually abandons it.
- He infers that most programs benefit from a strict, crashing style because clear failures make diagnosis and repair easier.
- The parable’s Mike is identified as Michael Burrows, later recognized as a prominent programmer.
- The author thanks colleagues on Airtable’s Performance & Architecture team for discussing these ideas and encouraging this write-up.
- A link invites readers to consider joining Airtable, and the author notes that this essay has been discussed in other places.
