What Is Toil? The Work SREs Try to Automate Away
Every Monday, someone at a small online shop exports last week's orders from the website and pastes them into the accounts spreadsheet. It takes an hour, nobody can skip it, and next Monday it starts again. Site reliability engineers (SREs) have a name for work like this. This lesson answers what is toil: how SRE defines it, what it is not, everyday examples, why teams cap it and how to cut it.
What SRE means by toil
You met toil in lesson 1 as repetitive manual work. Google's Site Reliability Engineering book is more precise: toil is work tied to running a production service, the live system users rely on, that tends to have six traits.
- Manual: a person does it. Running a script (a small program that carries out steps for you) by hand still counts: your minutes at the keyboard are toil.
- Repetitive: you have done it before and will again. The first or second time is not toil.
- Automatable: a machine could do it as well as you, or the need could be designed away. If it needs human judgement, it is probably not toil.
- Tactical: it is reactive, done because something interrupted you, not because you planned it.
- No lasting value: when you finish, the service is no better than before.
- Grows with the service: twice the users or servers means roughly twice the work.
Not every chore ticks every box, so treat the traits as a test: the more yeses, the surer you can be. The flowchart turns them into six questions. Notice that every "no" arrow points away from toil.
What toil is not
Toil is not simply work you dislike. Google's book sorts an SRE's other work into engineering and overhead, and both matter.
Engineering, whether writing software or improving systems, changes the service for good: writing automation, fixing the bug behind a repeated failure or building a feature. Even dull, fiddly work counts if it leaves a lasting improvement, such as tidying a messy settings file once so it stops causing mistakes.
Overhead is administrative work not tied to running the service: team meetings, planning goals, training and paperwork. It is necessary, however tedious, but it is not about running the service, so it is not toil.
On-call judgement calls are a grey area. On-call means taking turns to answer urgent alerts, called pages. Google counts routine page handling as toil, because it is reactive. But working out a new, confusing problem needs human judgement, so it fails the "automatable" test. The same alert with the same fix every week is toil; a problem nobody has seen before is not.
Everyday examples of toil
Four chores turn up on almost every team. Each passes the six-question test and has a better long-term answer.
- Restarting a stuck service by hand. An app freezes every few days and someone restarts it, but the cause, perhaps a memory leak (a program that keeps taking memory and never gives it back), remains. Fixing the leak ends the chore.
- Copying data between systems. Exporting a report from one tool into another each week is pure repetition. A scheduled job, a task a computer runs by itself at set times, can do it instead.
- Resetting passwords on request. Each reset is a ticket, a logged request, waiting for a person. A "Forgot password?" link lets users do it themselves, which is called self-service.
- Manually granting access. A colleague needs a dashboard (a page of live charts), so someone clicks through admin screens. A request form can grant access once a manager approves: the judgement stays human, the clicking moves to a machine.
Why SREs keep toil under half their time
Lesson 1 introduced Google's cap on operational work, the day-to-day running of a service. Its book sets the same goal for toil: below 50 percent of each SRE's time, so at least half goes to engineering that reduces future toil or adds features. The book's reason: left unchecked, toil tends to expand until it fills everyone's time.
The chart shows why it expands. Hand work grows in a straight line with the service, while automation costs extra effort once and then a little upkeep. Notice how the gap between the two lines widens every month.
A team that meets growth by hand must hire in step with it, the trap SRE was invented to avoid. Toil also wears people down: it is dull, teaches little, and steps repeated by hand invite slips, such as a command typed into the wrong window.
How to cut toil
Cutting toil is itself engineering work, in four steps.
- Measure it. For a week or two, note each chore and the minutes it took. Memory misleads: the 2 a.m. alert sticks, twenty small requests do not.
- Rank by time. Multiply how often a chore happens by how long it takes, and start at the top.
- Remove the cause if you can. Fixing why a service sticks beats any restart script, because nothing is left to do.
- Otherwise, automate it or make it self-service, so a machine, or the person asking, does it without waiting for you.
The chart shows one engineer's week after a single change: automating the restart of a stuck service. Two hours remain for checking the automation, like loading the dishwasher; the other ten moved into engineering.
Check yourself
You spend an afternoon untangling a messy settings file so it stops causing errors. It is dull. Is it toil?
No. It is not repeated and it leaves a lasting improvement, so it fails two of the tests. Dull is not the same as toil.
Your team has a password-reset script, but an engineer still runs it by hand for every request. Has the toil gone?
Only partly. The minutes spent running it are still toil, and they grow with requests. Self-service takes the engineer out of the loop.
A service sticks every night, and a teammate wants a script that restarts it automatically. What should you ask first?
Why does it stick? Removing the cause ends the chore for good, while an automatic restart can hide a problem that is getting worse.
Go deeper
- The Toil Audit: What SRE Work to Automate First: log two weeks of toil, score each chore and decide what to automate first.