Operations Updated

Toil: what it is and how to reduce it

Toil is the operational work that keeps a service running but does not make it better: manual, repetitive, automatable work that grows with the service. Some toil is unavoidable. Too much crowds out the engineering work that would remove it.

On this page
  1. The six properties of toil
  2. Examples, and what is not toil
  3. The 50% cap
  4. Measuring toil
  5. Choosing what to automate

The six properties of toil

Google’s SRE book defines toil as work tied to running a production service that tends to be:

PropertyMeaning
ManualA human runs it, even if that means running a script by hand.
RepetitiveIt is done again and again, not solved once.
AutomatableA machine could do it as well, or the need could be designed away.
TacticalIt is interrupt-driven and reactive rather than planned.
No enduring valueThe service is in the same state afterwards; nothing improved permanently.
Scales linearlyIt grows in proportion to traffic, users or service size.

Work does not need all six to be toil; the more it has, the more clearly it is toil.

Examples, and what is not toil

ToilNot toil
Manually restarting a service that leaks memoryFixing the memory leak
Hand-approving routine access requestsBuilding self-service access with audit logging
Running the same release checklist for every deployAutomating the pipeline that runs it
Resizing disks when an alert firesAutoscaling storage or capacity planning
Acknowledging pages that need no actionDeleting or fixing those alerts
Copying data between systems for each new customerDesigning the onboarding flow so it is not needed

Overhead such as meetings, planning, reviews and training is not toil either; it is necessary work that is not directly operational. Handling a genuinely novel incident is not toil, but the second time the same incident is handled by hand, it is heading that way.

The 50% cap

Google’s SRE organisation aims to keep operational work, including toil, below 50% of each SRE’s time, so that at least half goes to engineering that reduces future toil or adds features. The exact number matters less than having a cap, measuring against it, and acting when a team exceeds it, for example by handing work back to the development team or prioritising automation.

Measuring toil

Choosing what to automate

time saved over horizon ≈ frequency × minutes per occurrence × horizon − build time − upkeep

Start with tasks that are frequent, slow, error-prone or interrupt-driven at night. Count the cost of mistakes, not just the minutes: a quick task that goes wrong one time in fifty and causes an incident may cost more in incidents than in minutes. Weigh that expected cost against the cost of building and maintaining the automation, and remember that automation fails too, at machine speed, so give it safeguards and a limited blast radius. Also consider eliminating the task entirely by changing the design, which is often cheaper than automating it.

Ways to reduce toil, roughly in order of preference:

  1. Eliminate the need: fix the underlying bug, change the design, remove the feature.
  2. Self-service: let the requester do it safely without an operator.
  3. Automate the response, with safeguards and logging.
  4. Reduce frequency: batch it, or raise thresholds so it is needed less often.
  5. Document it well, as a stepping stone to automation, if none of the above is possible yet.

Sources: Google, Site Reliability Engineering, ch. 5 “Eliminating Toil”; The Site Reliability Workbook, ch. 6 “Eliminating Toil”.