Toil and automation
Toil is the manual, repetitive work that grows with the service. Measure it in hands-on hours, delete the need before you automate the task, and treat every automation as a production system with a blast radius
Your SRE team logs its time for a month. Which of these entries is toil by the SRE book's definition?
Toil is the work of keeping a service running that a machine could do and nobody has made it do. Every SRE team has some. The problem is not that it exists but that it grows: most toil scales with traffic, customers or services, so a team that does not fight it spends more of each quarter on it until there is no time left for the engineering that would remove it. Google’s SRE book makes the point in one line: toil “tends to expand if left unchecked and can quickly fill 100% of everyone’s time.”
At practitioner level you own a toil budget for your services. That means knowing how much toil the team carries, in hours, not in feelings; deciding what to do about each piece of it; and doing the engineering, or persuading another team to do it. The artefact is a toil audit with the return on each automation worked out. This chapter is about producing one a senior would accept, and about the judgment between the rows: when to automate, when to delete the need, and when to leave the toil alone.
What counts as toil
The SRE book’s definition, from Vivek Rau’s chapter, is the one the industry uses: “Toil is the kind of work tied to running a production service that tends to be manual, repetitive, automatable, tactical, devoid of enduring value, and that scales linearly as a service grows.” Each word carries weight.
| Trait | The test | Example at a payments company |
|---|---|---|
| Manual | A person starts it or does it | Reversing a stuck airtime top-up in the admin console |
| Repetitive | You have done it before and will again | The same reversal, forty times this week |
| Automatable | A machine could do it, or it could be designed away | The reversal follows four fixed checks |
| Tactical | It arrives as an interrupt, not from a plan | A support ticket or a page starts it |
| No enduring value | The service is the same afterwards | One customer is fixed; the cause is not |
| Grows with the service | Twice the traffic, twice the work | More transactions, more stuck ones |
Not every piece of toil has all six. Treat it as a spectrum, as the SRE Workbook does: the more traits a task has, the more surely it is toil.
Two things are often confused with toil. Overhead is work not tied to running the service: hiring, planning, performance reviews, team meetings. It is necessary and it does not count. Grungy engineering is unpleasant work with a lasting result, such as cleaning up the alert configuration or untangling a legacy deploy script once. The book is clear that this is not toil either, because the service is better afterwards.
One rule catches teams out. Running a script you wrote is still toil if a person has to start it, wait and check it. The book counts “the hands-on time a human spends running that script (not the elapsed time)”. A team that has scripted everything and still runs every script by hand has made its toil faster, not smaller.
Measure before you decide
The first audit almost always disagrees with what the team believed. The manager guesses 20%; the engineers say half their week; the tickets show something else again. Each is wrong in a predictable way. Managers see planned work and miss interrupts. Engineers remember the bad weeks. Tickets miss everything done in chat.
The Workbook’s method is plain: identify the toil, pick a unit of human effort, and track it before, during and after the work to reduce it. Minutes and hours are the unit it recommends, because everyone understands them. In practice you combine three sources over a period long enough to include a full on-call cycle, usually four weeks:
- The ticket system and the paging tool. Counts and timestamps. They give you frequency, not effort.
- A short daily time log from each engineer: fifteen minutes in a spreadsheet, each interrupt with a category and a duration. This gives you effort. Two weeks of it is tolerable; three months is not. If the team already keeps the weekly log described in an SRE’s week, start from that.
- Chat search. Requests in team channels that never became tickets. The Workbook calls ticket toil insidious because ticket-driven processes “usually accomplish their goal”, so nobody complains; chat requests are the same, only less visible.
Categorise each task with the Workbook’s taxonomy, which names where toil hides: business processes (requests from internal customers), production interrupts, release shepherding, migrations, cost and capacity work, and troubleshooting opaque systems. The categories tell you who to talk to. A business-process row needs the team that sends the requests; a release row belongs to whoever owns the pipeline, which infrastructure as code and delivery pipelines covers.
Then compute the share: toil hours over team capacity hours. Report the average and the worst individual week. Google’s surveys found an average near 33%, and the same paragraph notes that some SREs claimed 0% and others 80%; averages hide the person who is drowning, and that person is usually whoever was on call.
The 50% line, and the floor under it
Google’s SRE organisation sets a goal of keeping toil below 50% of each SRE’s time, averaged over a few quarters. It is Google’s number for Google’s SRE teams, not a law: some teams set 25% or 30%, and SRE philosophies sets out the argument. What makes it useful is the shape: a ceiling agreed in advance, measured, and defended, which the debt budget in the engineering manager track borrows for the same reason.
There is also a floor. The book’s arithmetic: with one week of primary and one week of secondary in every cycle, a six-person rotation spends at least 2 of every 6 weeks on call, so at least 2/6, or 33%, of each person’s time goes to interrupts. In an eight-person rotation the floor is 2/8, or 25%. If your team’s measured toil is near its on-call floor, the remaining toil is small and the fix is the pager, which the alert-design chapter and the manager’s view of pager load cover. If it is far above the floor, the toil lives in business processes, and that is where the audit pays.
The options, in order
For each row of the audit there are five things you can do, and the order matters because each later option leaves more of the work alive.
- Delete the need. Change the system so the task never arises. The Workbook calls this “the optimal strategy” and asks you to examine it before investing in managing toil. A memory leak that needs a daily restart is fixed in the code; a full disk is fixed in log rotation; a reconciliation mismatch caused by a partner sending local time is fixed by agreeing a time zone with the partner.
- Reject or defer it. The Workbook says that rejecting a toil-intensive task “should be the first option you consider” once the source cannot be removed: compare the cost of doing it with the cost of not doing it. An SLO helps here: if ignoring a class of task does not consume the error budget, you can let it wait, and an agreed error-budget policy, the subject of SLOs in practice, gives you the standing to say so. Batching is a form of deferral: twenty requests handled once a day cost less than twenty interrupts.
- Hand it back as self-service. Give the requester a form, a command or a pull-request template that does the thing. The Workbook’s sequence is to start with a human-backed interface, a structured request that an engineer still fulfils, then move to self-service once the request types are understood. The toil does not vanish; it becomes a few seconds of the requester’s time instead of an hour of yours.
- Automate it. Write the machine that does the task, triggered by the event rather than by a person.
- Accept it. Some toil is cheaper to do than to remove, and the book says outright that toil in small doses is fine. Accepting it is a decision, written in the audit with the reason, not a default.
Automation is a ladder
Automation itself comes in stages, and you rarely jump to the top. The SRE book’s chapter on automation at Google describes five, using database failover as the example: no automation; a script in one SRE’s home directory; a generic script everyone uses; automation shipped with the system itself; and a system that needs no automation because it detects the problem and fails over on its own. The last stage is option 1 above arrived at from the other side.
Dan Slimmon’s do-nothing script is the cheapest first rung. You turn a runbook into a script with one function per step, and each function prints the instruction and waits for the operator to press Enter. It automates nothing. As Slimmon puts it, “It lowers the activation energy for automating tasks, which allows the team to eliminate toil over time”: every step is now a function you can replace with code, one at a time, starting with the step that hurts most.
The trap at the bottom of the ladder is automating the symptom. The Workbook includes John Looney’s account of his first Google assignment: more than 20,000 broken machines at any time, and about a thousand of them with a root filesystem full of logs from a patched network driver. His plan was a script to truncate the logs everywhere; a teammate pointed out “it’s better to fix root causes when possible”. A script that masks a fault makes the toil disappear from the audit and leaves the fault in production.
Automation ROI: the arithmetic and its limits
The return on a toil project is a payback period:
payback (months) = build hours ÷ (hours saved per month − maintenance hours per month)
Three rules keep it honest.
Count every team’s hours. The best fix is often in another team’s code: the payments squad adds a status check, the support-tools team adds a button. Their hours are part of the build cost, and they are the hours you have to win in planning. A project that is free to you and costs a squad three weeks is not free.
Count maintenance. Automation is software. It breaks when the system it drives changes; the automation chapter calls this “bit rot” and notes that automation run only every few months is especially fragile, because nobody finds out it is broken until it is needed. A few hours a month is a reasonable rule of thumb for a small tool; a large one needs an owner.
Count growth. Toil that scales with traffic grows each month, and so do the savings. A project with a six-month payback today may pay back in four if volume grows 5% a month. Randall Munroe’s xkcd “Is It Worth the Time?” is the classic table for the simple case: how long you can spend automating a task, given how often you do it and how much time you save, over five years.
Then the limit. The Workbook warns that projects that look unprofitable on hours alone “might still be well worth undertaking”, and lists why: fewer outages from human error, less context switching, faster response to users, better security, shorter training, lower attrition. The honest way to use that list is to name the specific benefit and its evidence in the row (the expired credential that caused last year’s outage, the engineer who left citing the rotation), not to wave the list at every project with a bad payback.
Automation as a production system
The Diskerase story is what happens when automation has admin powers and the checks a human would apply. A person sending an entire fleet to be wiped would have stopped at the number. The automation did not look.
The Workbook’s section on assessing risk within automation gives the practices, and they belong in the audit row for any automation that changes production:
- Validate input defensively, even from systems you own. An empty list, a negative count and a wildcard are inputs.
- Build in the checks a human would make: a cap on how many things it changes per run, a rate limit, a check of current health before acting. The runbooks chapter makes the same point about AWS’s 2017 S3 outage: move the guard from the document into the tool.
- Make every step idempotent, so a rerun after a half-finished run does the right thing. Google made the decommission workflow idempotent after Diskerase; idempotency is the mechanism.
- Default to a human. The Workbook: “Automation should default to human operators if it runs into an unsafe condition.” Unknown states go to a queue a person reads, never to the most destructive branch.
- Watch it like a service. Alert on its error rate and on the volume of what it does, so a run that suddenly does ten times the usual work pages someone before it finishes.
Automation also changes the people. The automation chapter borrows the point from aviation: when automation covers the daily work, operators lose practice, and when it fails they may be unable to run the system by hand. Keep the runbook for the manual path, and exercise it.
Where practitioners disagree
Who does the toil? One camp says SREs should hand excess operational work back to the developers who own the service, so the cost is felt by the people who can fix it. The other says SREs exist partly to absorb it and should not use it as leverage. The SRE book’s position is the first, as a safety valve: excess operational work is redirected to the product development teams until the load drops back to 50% or lower.
Self-report or measurement? Self-reports overstate toil because people remember the worst days; tickets understate it because interrupts in chat leave no trace. Use both and say which number you are quoting.
Is all toil bad? The book says no: some people find repetitive tasks calming, and small doses are fine. It also says toil “becomes toxic when experienced in large quantities”. The audit is how you tell which you have.
Selling the work
Toil reduction takes engineers off features for weeks to give time back over months, and the people who lose the weeks are entitled to ask what they get. The Workbook’s advice is to get management agreement that toil reduction is worth doing, to use objective toil metrics when you push back on new demands, and to tie the work to something the customer of the toil already wants, such as security or reliability, rather than pitching it as a gift to the SRE team.
In practice that means three habits. Bring the audit, not an anecdote: “stuck top-ups cost us 90 hours last month and are growing 5% a month” lands where “the reversals are killing us” does not. Ask the owning team’s PM and engineering manager for a specific number of weeks, and say what it buys in their terms: fewer customer complaints, faster refunds. And report afterwards in hours returned and what the hours bought, because the next request depends on whether the last one paid back. When the fix crosses several teams, the playbook in cross-team projects and migrations applies; when the answer is a tool you could buy, build vs buy is the frame.
Day to day
Every day. You log interrupts as they happen, in the team’s toil log: what, how long, which category. It takes a minute per entry and is the only source that captures chat requests. If you are on call, you note which pages and requests were repeats of last week’s.
Every week. In the team’s planning or operations review, thirty minutes, you look at the week’s toil hours against the budget and the top three sources. A source that appears three weeks running becomes a row in the audit. The on-call handoff names any new toil the shift discovered.
Every month. You update the audit: measured hours per row, progress on the projects funded, payback achieved against payback promised. You spend an hour with the engineering managers whose teams generate the most toil, with the numbers, before they plan their next cycle.
Every quarter. You run the full audit again, with two weeks of time logs, and present it at quarterly planning: the toil share, the trend, the projects that paid back, the ones that did not, and the asks for next quarter. You also retire automation that nobody uses and review the safeguards on anything that changes production.
On your own time budget. At practitioner level, expect to spend about a day a month keeping the audit and the conversations around it alive (a rule of thumb). The engineering it leads to is most of your project time.
Nobody is called an SRE, and the toil lands on whichever engineers know the production system best, usually the founders’ first hires. There is no audit and there should not be a heavy one. Keep a shared list of every manual task anyone does more than twice, with a rough time per week. Fix the cheapest causes at the source, because the code is small and you own all of it. Do not build internal tools yet: most early toil disappears when the product changes. The danger is that heroics become culture and the one person who knows the manual steps becomes the system.
This is where the audit earns its keep. A small SRE or platform team is serving many product squads, and its toil grows with every new service and customer. The toil is mostly business processes: requests for credentials, onboarding, reversals, reconciliation. Most of the fixes live in other teams’ code, so the work is persuasion with numbers in quarterly planning. Agree a toil cap with your manager, measure against it each month, and build self-service where requests repeat. Resist writing a general automation platform before the third repetition of the same tool.
Toil is measured, sometimes by survey, and a cap may be written into the SRE team’s charter, with the right to hand work back to developers when it is breached. The politics is about who owns the toil: shared services generate requests from hundreds of teams, and the owning team’s roadmap is set elsewhere. Automation is a product with users, an owner and an SLO. Change control and audit requirements add steps that look like toil and are not optional; the work is to automate the evidence, not to skip the control.
Template
# Toil audit: <team>, <period>
Author · Date · Reviewed with: <manager, owning teams>
## Method
Period: <four weeks, dates> · Sources: <tickets, pager export, daily time log, chat search>
Capacity: <people> x <hours per month> = <hours>
Excluded as not toil: <overhead, one-off engineering>
## Summary
Toil: <hours> h = <share>% of capacity (worst individual week: <share>%)
Cap agreed: <share>% · Top three sources: <rows>
After funded work: <hours> h = <share>%
## Inventory
| # | Task | Category | Trigger | Count | Min each | Hours | Grows with | Owner of the cause |
|---|---|---|---|---|---|---|---|---|
## Options and ROI
| # | Chosen option (delete / reject / self-service / automate / accept) | Why not an earlier option | Build h (by team) | Maint h/month | Saved h/month | Payback months | Other benefit, with evidence |
|---|---|---|---|---|---|---|---|
## Safeguards (for any automation that changes production)
| # | Input checks | Cap or rate limit | Idempotent? | Unsafe condition goes to | Alerting on the automation |
|---|---|---|---|---|---|
## Funded this quarter
| # | Owner | Team hours asked | Done when |
|---|---|---|---|
## Accepted or routed elsewhere
- <row>: <reason, or where it goes>
## Re-run
<Date of the next audit, and what will be measured> WORKED EXAMPLE
Zircon is a fictional mobile airtime and bill-payments company: 140 people, 45 engineers, 1.2 million top-ups and bill payments a day across 14 mobile network operators (MNOs) and 60 billers. Ochieng, one of four SREs, ran this audit for Pendo, the Senior SRE who leads the team.
Method. Four weeks; tickets, pager export, a daily time log and chat search. Capacity 4 × 160 = 640 hours.
Inventory. Reversing stuck top-ups after MNO timeouts, 600 × 9 min = 90 h, growing about 5% a month with volume. Electricity token re-sends for support, 300 × 6 min = 30 h. Pages, 45 × 40 min = 30 h. Biller reconciliation mismatches, 30 × 60 min = 30 h. New biller onboarding, 6 × 4 h = 24 h. Release shepherding, 60 × 20 min = 20 h. Log clean-up on ledger replicas, 12 × 20 min = 4 h. MNO credential rotation, 5 × 45 min = 3.75 h. Total 231.75 h, 36% of capacity; the SRE on call in week three logged 28 of 40 hours, 70%.
Options and ROI. Stuck top-ups: delete the need. The payments squad calls the MNO status API on timeout and settles or reverses automatically; 11 of 14 MNOs have one, covering 85% of cases. Build 140 h (120 payments squad, 20 SRE), maintenance 4 h a month, saves 76.5 h a month; payback 140 ÷ 72.5 = 1.9 months. Safeguards: reverse only on an explicit MNO failure, unknown states to a human queue, at most 500 automatic reversals a day, alert at twice the baseline rate. Token re-sends: the cause is SMS delivery failures at the operators, which Zircon cannot delete, so self-service: a re-send button in the support tool, 40 h of the support-tools squad, saves 28 h, maintenance 1 h; payback 1.5 months. Reconciliation: 70% of mismatches come from two billers sending local time with no zone; the partnerships lead asks them for UTC, 10 h, saves 21 h. Log clean-up: fix log rotation, 2 h. Credential rotation: the MNOs require it, so it cannot be deleted or rejected; automation would take 50 h to save 3.5 h a month, a 14-month payback, but an expired credential cut off one MNO for 40 minutes last year, so a do-nothing script now (8 h) and automation next quarter. Onboarding (payback 4.6 months) next quarter. Pages and releases routed to the alert review and the pipeline work.
After funded work: 231.75 − 129.5 = 102.25 h, 16% of capacity. Re-run in twelve weeks.
Now you
You are an SRE on the platform team at Mica, a fictional genomics lab data platform: 90 people, 30 engineers, 2,400 samples a week for 60 research and clinical customers, 1.8 PB in object storage. The platform team is five people, three of them SREs. Tumelo, the Platform Lead, estimates SRE toil at 20%; the three SREs say it is over half their week. Recurring work includes re-running failed pipeline jobs, fixing malformed sample sheets, raising storage quotas, restoring archived data from cold storage on customer request, creating SFTP accounts for new lab partners, and renewing certificates. The lab is accredited, and Kasper, the quality manager, requires a validation record for any change to how sample data moves. The data portal team wants two SRE weeks next quarter for a feature. Write the toil audit for the next planning round: say how you will measure, what you expect to find, and how you will handle the rows where automation touches sample data.
Self-check
You are Rehema, an SRE at Mica, a 90-person genomics lab data platform. Malformed sample sheets from the lab fail nine pipeline runs a week. Each costs the on-call SRE about 25 minutes to correct the sheet and re-trigger the run, roughly 16 hours a month, and delays a customer's results by a median of six hours. Seven error types cover nearly every case. The sheets are uploaded through the LIMS, owned by Ekow's team, which is committed to a customer feature this quarter. Every change to how sample data moves needs a validation record from the quality team. What do you do?
- BOOK Site Reliability Engineering, chapter 5: Eliminating Toil Vivek Rau, ed. Betsy Beyer, 2016
The definition of toil, the 50% goal, the on-call floor arithmetic and the survey numbers. Short; read all of it before your first audit. Read: Site Reliability Engineering (O'Reilly, 2016), chapter 5.
- BOOK The Site Reliability Workbook, chapter 6: Eliminating Toil David Challoner, Joanna Wijntjes, David Huska and others, 2018
The practical companion: how to measure toil, the taxonomy, the management strategies from rejecting toil to self-service, and two long case studies. The section on assessing risk within automation is the checklist for safeguards. Read: The Site Reliability Workbook (O'Reilly, 2018), chapter 6.
- BOOK Site Reliability Engineering, chapter 7: The Evolution of Automation at Google Niall Murphy with John Looney and Michael Kacirek, 2016
Why automation is worth more than the hours it saves, the five stages from a script in a home directory to a system that needs none, and the Diskerase outage. Read: Site Reliability Engineering (O'Reilly, 2016), chapter 7.
- POST Do-nothing scripting: the key to gradual automation Dan Slimmon, 2019
The cheapest first rung of automation, with code. Use it on the first procedure in your audit that is too branchy to automate in one go.
- BOOK The Practice of Cloud System Administration Thomas A. Limoncelli, Strata R. Chalup and Christina J. Hogan, 2014
The operations view of what to automate and what not to, from practitioners who ran large services. Read chapter 12 alongside the SRE book for a second opinion. Read: Addison-Wesley, 2014; chapter 12, Automation.
- BOOK Seeking SRE David N. Blank-Edelman (ed.), 2018
Essays from engineers at many companies on how SRE works outside Google. Useful when your team's toil cap and operating model cannot copy Google's. Read: O'Reilly, 2018.
- POST Is It Worth the Time? Randall Munroe
A one-glance table of how long you can spend automating a task before it stops paying back over five years. Keep it next to the audit, and remember it counts only your hours.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.