Pidoku

Archive

This learning material is in the archive. It is not currently maintained and has not been updated with the latest information, so tool versions, prices and dates may be out of date.

Designing On-call

Module 4 Lesson 4.a 40 min Difficulty 2/5

Prerequisites 3.c

The idea in one minute#

On-call is a rotation of engineers who respond to pages for a service, around the clock. It works when three things are true: the rotation is big enough that each person is on call rarely (Google’s guidance: no more than 25% of time on call), the load is low (at most about two incidents per 12-hour shift, so every incident gets a proper response and follow-up), and the people on call have the authority, access and runbooks to fix things.

When these are false, on-call burns people out — and tired, overloaded people make the mistakes that cause the next outage.

An analogy#

Firefighters work in shifts, with a crew big enough that no one is on duty every night, with equipment checked at every handover, and with a station chief they can call. A fire station where one person is on duty every night, with a key to only half the building, does not stay staffed for long.

A picture#

flowchart LR
  subgraph EU["Europe — 08:00–20:00 UTC"]
    E1[":i-user: Primary"]
    E2[":i-user: Secondary"]
  end
  subgraph US["Americas — 20:00–08:00 UTC"]
    U1[":i-user: Primary"]
    U2[":i-user: Secondary"]
  end
  AL[":pagerduty: <b>Page</b>"] --> E1
  E1 -->|"no ack in 5 min"| E2
  E2 -->|"no ack in 10 min"| MGR[":i-user: Manager<br/>on escalation"]
  E1 -->|"handoff note<br/>at shift change"| U1
  U1 -->|"handoff note"| E1
  class AL warn
  class E1,U1 compute
  class E2,U2 queue
  class MGR neutral

How it really works#

Rotation shape#

ModelHow it worksGood for
Weekly, single siteOne person primary for a week, 24×7Small teams, low page volume
Primary + secondarySecondary is the escalation if primary misses the ack, and a second pair of handsMost teams
Follow-the-sunTwo or three sites each cover their daytime (e.g. 12 h each)Teams spread across time zones — nobody is paged at night
Business-hours + best effortPages only in working hours; nights go to a shared rotation or not at allInternal services with a loose SLO

How big must the rotation be?#

Google’s SRE book gives numbers worth copying:

  • At most 25% of an SRE’s time on call — the rest is project work (with up to 25% more for other operational work, making the 50% cap from 1.a).
  • So a single-site 24×7 rotation needs at least 8 engineers (with primary and secondary, each person is primary one week in eight).
  • A two-site follow-the-sun rotation needs at least 6 per site.

With fewer people, either the shifts become too frequent, or the rotation is quietly covered by a few heroes — which works until they leave.

How much load is sustainable?#

  • Target: at most two incidents per 12-hour shift. An “incident” may be several pages about the same problem. Two leaves time to respond properly, write it up and fix something.
  • If the load is consistently higher, the response is engineering: reduce noise (3.c), fix the top causes, or give the pager back to the development team until it is better.
  • If the load is consistently zero, people lose their skills. Practise with game days and “wheel of misfortune” exercises (Module 10).

Response expectations#

Write them down:

SeverityAck withinHands on keyboard withinExample
Page (critical)5 min15 minCheckout error budget burning fast
Page (high, business hours only)30 min1 hInternal tool down
TicketNext business day—Disk at 85%, cert expires in 3 weeks

A 5-minute ack means the on-call person carries a laptop and has connectivity. That is a real constraint on their life, and why on-call should be paid — either as a stipend per shift, time off in lieu, or both. Unpaid 24×7 on-call is how teams lose their best people.

The handoff#

At every shift change, the outgoing person writes a short note:

On-call handoff — payments — 2026-10-20 08:00 UTC

Incidents this shift:   1  (INC-2219: checkout 503s after deploy, rolled back, postmortem owner @ana)
Still open:             DB replica lag alerts flapping on db-3; ticket OPS-5512, not urgent
Silences in place:      "InventoryLatency" until 2026-10-20 12:00 (vendor maintenance window)
Risky changes today:    Payments provider migration step 3 at 14:00 UTC (owner @raj)
Things I did not finish: Re-enable feature flag checkout-v2-ui after INC-2219 fix lands

Five lines save the next person from rediscovering everything.

Before someone’s first shift#

  • Access: production read access, the ability to roll back, scale and toggle flags; a working VPN and paging app — tested, not assumed.
  • Shadowing: one or two shifts as a shadow (sees every page, does not own them), then as primary with an experienced secondary.
  • Knowledge: service architecture, SLOs, the runbooks, the escalation contacts.
  • Practice: at least one “wheel of misfortune” (10.c) on this service.

The on-call health review#

Monthly, per rotation:

  • Pages and incidents per shift; how many outside working hours.
  • Actionable percentage (3.c).
  • Time spent on call-driven work versus project work.
  • A one-question survey: “How sustainable did on-call feel this month, 1–5?”

When the numbers are bad, the fix is engineering, not resilience training.

A worked example#

A team of 5 engineers, single site, weekly 24×7 rotation, no secondary. Each person is on call one week in five (20% of time), but is also the only responder, so there is no escalation. Page volume: about 28 pages a week, 12 at night.

Problems: no secondary; load of ~2 pages per 12 h shift on average but bursty; one person has covered 9 of the last 20 weeks because others swapped out.

Changes:

  1. Add a secondary (needs 8 people for 1-in-8 primary; the team borrows 3 from a sister team for a joint rotation covering both services).
  2. Alert review removes 60% of pages (3.c).
  3. Introduce a per-shift stipend and a rule: a night with more than one page earns the next morning off.
  4. Track who covers which shift; nobody may exceed 1 in 6 over a quarter.

The program below generates a rotation and checks it against these rules.

Code#

Go
// rotation.go — build a primary/secondary rotation and check it against on-call health rules.
package main

import (
	"fmt"
	"time"
)

type shift struct {
	start              time.Time
	primary, secondary string
}

func main() {
	team := []string{"ana", "raj", "li", "omar", "sara", "kim", "tom", "eva"}
	start := time.Date(2026, 11, 2, 9, 0, 0, 0, time.UTC) // Monday 09:00
	const weeks = 16
	const incidentsPerWeek = 9.0                // after the alert review
	swaps := map[int]string{3: "ana", 4: "ana"} // weeks where someone covers for a colleague

	var shifts []shift
	for w := 0; w < weeks; w++ {
		p := team[w%len(team)]
		s := team[(w+len(team)/2)%len(team)] // secondary is half a rotation away from their primary week
		if who, ok := swaps[w]; ok {
			p = who
		}
		shifts = append(shifts, shift{start.AddDate(0, 0, 7*w), p, s})
	}

	fmt.Println("week starting   primary  secondary")
	for _, s := range shifts {
		fmt.Printf("%s   %-8s %s\n", s.start.Format("2006-01-02"), s.primary, s.secondary)
	}

	// Health checks.
	fmt.Println("\nchecks:")
	primaryWeeks := map[string]int{}
	onCallWeeks := map[string]int{}
	for i, s := range shifts {
		primaryWeeks[s.primary]++
		onCallWeeks[s.primary]++
		onCallWeeks[s.secondary]++
		if s.primary == s.secondary {
			fmt.Printf("  FAIL week %d: %s is both primary and secondary\n", i, s.primary)
		}
		if i > 0 && shifts[i-1].primary == s.primary {
			fmt.Printf("  WARN week %d: %s is primary two weeks running\n", i, s.primary)
		}
	}
	for _, name := range team {
		share := float64(onCallWeeks[name]) / weeks
		status := "ok"
		if share > 0.25 {
			status = "OVER 25% on call"
		}
		fmt.Printf("  %-5s primary %2d wk, on call %2d of %d wk (%3.0f%%)  %s\n",
			name, primaryWeeks[name], onCallWeeks[name], weeks, share*100, status)
	}
	perShift := incidentsPerWeek / 14 // 14 twelve-hour shifts per week
	fmt.Printf("\nload: %.1f incidents per 12 h shift (target ≤ 2)\n", perShift)
	fmt.Printf("minimum single-site rotation for 1-in-8 primary: 8 people; this team has %d\n", len(team))
}

The swaps in weeks 3 and 4 are there on purpose: one well-meant favour makes ana primary twice in a row, primary and secondary in the same week, and on call for 38% of the quarter. Those are exactly the patterns that go unnoticed without a check.

Remember this#

  • At most 25% of time on call; single-site 24×7 needs about 8 people, follow-the-sun about 6 per site.
  • At most about two incidents per 12-hour shift; more means engineering work, not more heroics.
  • Primary and secondary, written response times, paid on-call.
  • Handoff notes at every shift change; shadow before your first shift.
  • Review on-call health monthly.

Try it#

  1. Run rotation.go. Remove three people from team. Which checks fail?
  2. Write a handoff note for your last on-call shift (or an imagined one) using the template.
  3. Write the response-time table for a service you know.

Check yourself#

  1. Why does a 24×7 single-site rotation need about eight people?
  2. What should happen when a rotation consistently exceeds two incidents per shift?
  3. What is the secondary for?
  4. Name three things a new on-call engineer must have before their first shift.

Sources#

↑↓ navigate↵ openesc close

100% drag to pan · scroll or pinch to zoom · double-click to zoom in