What Site Reliability Engineering Is
Site Reliability Engineering (SRE) is what happens when you treat running a production service as a software problem. Google coined the term in 2003 for a team of software engineers who were given the operations job and told to automate it. The ideas spread through Google's two free books, Site Reliability Engineering (2016) and The Site Reliability Workbook (2018), both readable at sre.google.
This course is the operational half of reliability. System Design covers availability, SLAs, redundancy and idempotent retries from the architect's point of view; here you learn to measure reliability, alert on it, respond when it breaks, learn from each failure and test how the system behaves when parts of it fail.
The core ideas
| Idea | In one sentence |
|---|---|
| 100% is the wrong target | users can't tell 99.99% from 100% through their own flaky Wi-Fi, and every extra nine costs more than the last |
| SLOs | agree on a measurable reliability target (an objective) for what users experience |
| Error budgets | the gap between the SLO and 100% is a budget the team may spend on change; when it's gone, reliability work comes first |
| Toil | manual, repetitive, automatable work that grows with the service; SRE caps it (Google's guideline: under 50% of an SRE's time) |
| Blameless postmortems | after an incident, ask what in the system let it happen, not who to blame |
| Alert on symptoms | page a human when users are hurt or soon will be, not whenever a CPU is busy |
| Shared ownership | developers and SREs own production together; SRE support can be handed back if a service is too noisy |
SRE, DevOps and platform teams
DevOps is a culture and a set of practices (see DevOps vs SRE vs Platform Teams). Google's own summary is "class SRE implements interface DevOps": SRE is one concrete way to do DevOps, with specific tools such as SLOs, error budgets and toil limits. Many companies have no team called SRE but still use these practices; others have SREs embedded in product teams or a central SRE team that consults.
Toil, measured
Toil is work that is manual, repetitive, automatable, tactical, without lasting value, and that grows linearly with the service. Restarting a stuck worker by hand every week is toil; writing the fix that stops it getting stuck is engineering. The model tracks a small team's quarter: toil grows with traffic unless engineering time goes into automating it away.
# hours per week for a team of 4 SREs (160 h/week); toil grows 4% a week with traffic
WEEKS, TEAM_HOURS = 13, 160
def quarter(automation_share):
toil = 60.0 # hours of toil in week 1
print(f"engineering time spent on automation: {automation_share:.0%}")
for week in range(1, WEEKS + 1):
engineering = TEAM_HOURS - toil
automated = engineering * automation_share * 0.05 # 5% of automation hours retire toil for good
if week in (1, 5, 9, 13):
print(f" week {week:2}: toil {toil:5.1f} h ({toil / TEAM_HOURS:4.0%}) engineering {engineering:5.1f} h")
toil = max(0.0, toil * 1.04 - automated)
return toil
quarter(0.0)
quarter(0.6)engineering time spent on automation: 0%
week 1: toil 60.0 h ( 38%) engineering 100.0 h
week 5: toil 70.2 h ( 44%) engineering 89.8 h
week 9: toil 82.1 h ( 51%) engineering 77.9 h
week 13: toil 96.1 h ( 60%) engineering 63.9 h
engineering time spent on automation: 60%
week 1: toil 60.0 h ( 38%) engineering 100.0 h
week 5: toil 57.3 h ( 36%) engineering 102.7 h
week 9: toil 53.8 h ( 34%) engineering 106.2 h
week 13: toil 49.3 h ( 31%) engineering 110.7 h
Without automation, toil passes half the team's time within the quarter, and the team becomes an operations team that can't improve anything. Spending most engineering time on automation makes toil shrink even though the traffic grows, and frees hours for the next improvement. The numbers are invented, but the shape is the reason SRE teams measure toil and cap it.
How this course is built
- Runnable models in Python simulate SLIs, error budgets, burn-rate alerts, retries, circuit breakers, queues and load shedding. Each is deterministic (seeded randomness), so you can change a parameter and compare.
- Real tool sessions (
bashblocks marked as runnable) use Prometheus 3.15'spromtoolto test SLO recording rules and burn-rate alerts on synthetic series, andamtoolto test Alertmanager routing. Each one runs in a fresh container with no network. - Sample sessions show tools that need a cluster: Sloth, Pyrra, k6, Chaos Mesh and LitmusChaos.
- Templates for the documents SREs write: SLO documents, runbooks, incident updates and postmortems.
You should know Prometheus metrics, PromQL and alert rules from Observability, and the availability arithmetic from Availability and SLAs. Security incidents have their own process (evidence, containment, disclosure): see Incident Response.
Test yourself
Why is 100% the wrong reliability target for most services?
- It is impossible to measure
- Users can't perceive the difference beyond a point, and each extra nine costs more while blocking change
- Prometheus can't store 100%
- SLAs forbid it
Which of these is toil?
- Designing a new caching layer
- Manually rotating the same certificate on 40 hosts every 90 days
- Writing a postmortem
- Reviewing an SLO with the product owner
What does the error budget give a team?
- Money for cloud costs
- An agreed amount of unreliability it may spend on change before reliability work takes priority
- A list of bugs
- Permission to ignore incidents