On call for what you built
When the pager is yours you know the system best and trust it most, so decide in daylight what you will try, how long you will try it alone and when you will wake someone, and write it into a runbook your tired self can follow
At 02:10 your alert says the scheduled-batch executor you built has stopped claiming due batches. You are primary on call and half awake. What do you do first?
You wrote the scheduler and the executor. In January customers start scheduling payouts up to 30 days ahead, and from then on a stalled executor at 02:10 is your problem, whoever’s name is on the rota that week. This chapter is about carrying the pager for your own service as an individual engineer: what to have ready before the shift, what to do in the first half hour, when to wake someone, which recovery steps can make things worse, and what you leave behind. It does not set the policy. The rota, the paging rules, pay and the staffing arithmetic belong to on-call done right. How an organisation declares and reviews incidents belongs to incident management. How your manager watches the health of the rotation is in on-call and incidents for managers. How to write the handoff note and measure pager load is in the course chapter on runbooks and on-call. Read those for the frame. This chapter is the view from the person holding the phone.
The model: the builder is the expert and the weak link
Werner Vogels put the principle in a 2006 interview: if you build it, you run it. The reasoning is sound. An engineer who is woken by their own code writes better alerts, simpler failure modes and safer defaults than one who never sees a failure. The cost is that the builder arrives at 02:10 with two biases.
The first is confidence. You know how the executor is meant to behave, so you read the logs looking for the story you already believe. The second is isolation. At night nobody is watching, nobody asks “are you sure?”, and the clock makes every extra minute feel expensive. Neither bias is in AWS’s account of S3, but both are what a lone engineer at night has to guard against.
The answer is to turn judgement into procedure ahead of time. Three jobs follow.
- Before the shift, make it safe to hold the pager. Access, a charged phone, a read runbook, a handoff, and a number for how much of your life this rota takes.
- In the first half hour, bound the harm and share the load. Impact first, safest step second, a time limit, then a second person.
- After the shift, leave the next person better off. A note, a fixed runbook step, a ticket for the cause.
Everything below is one of those three.
Before your shift
Most bad nights are decided on the Tuesday before. A short checklist, done at handover, catches the failures that are embarrassing at 02:10: a laptop that will not connect, a permission you never had, a runbook step that has changed since you last read it.
| Check | What good looks like | The failure it prevents |
|---|---|---|
| Phone and paging app | A test page reaches you with the phone on silent, and you know how to acknowledge it | A page that rings out unanswered while you sleep |
| Access | You can reach the dashboards, the deploy tool and the production console from home, today | Finding at 02:10 that your credentials expired |
| Handoff note | You have read what the outgoing engineer saw, the silences left in place and the changes in flight | Repeating a diagnosis someone finished last week |
| Runbook | You have read the entries for the services you own, and you have noticed which steps you do not understand | Following a stale step with confidence |
| Your secondary | You know who it is and how to reach them, and they know it too | Paging a colleague who did not know they were secondary |
| Your calendar | No deploy, migration or flight inside your shift unless someone has agreed to swap | Being paged mid-air |
At Ferrowave, Payouts Core’s rota has four people, down from six, and runs weekly shifts with a primary and a secondary. That is a new fact for this track and it is illustrative. The arithmetic is short enough to carry in your head. A week of primary and a week of secondary make two on-call weeks in every four, which is 50% of your working life, and about 57% once you count six weeks of leave a year. At six people the same rota was 33% and about 38%. On-call done right derives these figures and sets them against the 25% limit in Google’s SRE book.
You cannot fix the rota on your own, and you should not pretend the numbers are fine. You can write the figure down and take it to your tech lead before the next planning round. A shortage that has a number attached gets handled; a shortage that is only a feeling gets endured.
The first thirty minutes
A page is a claim that something users care about is breaking. The sequence below works for most pages about a service you built. It is a rule of thumb, not a standard, and teams vary the details.
- Acknowledge. Say you have it, so the page does not escalate while you are looking. Note the time.
- Read the alert as written. What did it measure, and is it firing now or did it fire and clear?
- Bound the harm. Who is affected, how many, and what time makes it worse? Write the answer in one line before anything else. For Ferrowave’s executor: 31 batches, about 9,400 payouts, due at 06:00.
- Take the safest documented step. The runbook has an entry for this alert. Check its precondition, then take the step that is cheapest to undo.
- Set a time limit. Decide aloud how long you will work alone. Twenty minutes with no sign of progress is a common rule of thumb; your runbook should say your own number.
- Tell someone. Not for permission, but so the second person is already awake when you need them.
- Look for the cause once the harm is bounded, or hand that to the person you called.
The order matters because of the clock. Step 3 takes thirty seconds and decides how much time you have. Step 4 usually costs one minute and sometimes ends the night. Step 7 can take hours, and it is the step an engineer’s instincts jump to first.
Ferrowave’s executor, with the clock written down
The numbers below are illustrative and are the ones used in the runbook later in the chapter.
| Fact | Value | What it tells you |
|---|---|---|
| Payouts due at 06:00 on the 25th | 31 batches, about 9,400 payouts | How big the harm is |
| Normal rate | about 3.5 payouts a second, so about 45 minutes for 9,400 | How long recovery takes once the executor works |
| Payroll customers’ promise to staff | Paid by 07:00 | The real deadline, not the 06:00 schedule |
| Latest healthy start | 06:15 | 07:00 minus 45 minutes; 9,400 at 3.5 a second is 44.8 minutes, so 06:15 leaves under a minute to spare |
| Time now, with two things tried | 02:10 | 4 hours 5 minutes of margin, and shrinking |
Nothing here needs a diagnosis. It needs a calendar and a calculator, and it tells you that you have four hours before the harm is certain and that the time to ask for help is while you still have most of them.
When to wake someone
Engineers are reluctant to page a colleague at night, for good reasons: it costs them sleep, it feels like admitting you cannot cope, and the problem may fix itself. The reasons point the wrong way, because the cost of waking a colleague is one night of broken sleep, while the cost of not waking them can be a payroll missed by thousands of people.
Make the decision mechanical.
- Escalate by time. If you have made no progress after your time limit, page the secondary as a matter of routine. The on-call policy makes this a rule so that asking is a procedure, not a confession.
- Escalate by stop sign. The runbook lists conditions that mean stop and call: a state you do not recognise, a step whose precondition fails, any sign that money has moved twice.
- Escalate by cost of being wrong. When a recovery step is hard to reverse, such as anything that moves money, the second opinion is cheap by comparison.
When you page, send a message the other person can act on at 02:15 without asking a question. Five parts do it:
Executor stalled since 01:50. 31 batches, about 9,400 payouts due 06:00;
staff pay promised by 07:00. Tried: confirmed the process is up; cleared the stale
lock (no change). Two batches are in "executing" (one at 212 of 300),
so the runbook restart is not safe. Please join: I need your read of
the ledger before I touch those two.
The symptom, the harm, the deadline, what you tried and what you ask for. The tech lead who reads that knows within ten seconds whether to get out of bed and what to open first.
Declaring an incident
Declaring an incident is a separate decision from escalating. Escalating gets a second engineer on the problem. Declaring starts the organisation’s response: a channel, a commander, an update cadence, a postmortem. Incident management explains why declaring should be cheap and how a company sets severity levels, and when you are unsure which level applies it advises taking the higher one. Your part, as the engineer on the page, is small and specific.
- Know your company’s trigger. Ferrowave’s, for this chapter, is that customers are late or failing, or you need people from another team. That is a new fact and illustrative.
- Declare when the trigger is met, without waiting to be certain of the cause. You declare on impact, and the cause can come later.
- Once a commander is named, hand over the coordination. You go back to fixing. The technical lead’s seat in a large incident is covered in leading a sev-1.
- Give customer success what they need to write to customers: what is affected, since when, what you are doing, and when you will next update them. At Ferrowave that means Eloise, who looks after payroll customers’ messages.
A common mistake is to treat declaring as an admission. It is a request for the structure that makes a bad night shorter.
Recovery steps that can make it worse
Some recovery steps cost nothing if they are wrong, such as restarting a stateless web server. Others cost real money, and a payout service is full of them. Three rules keep a tired engineer out of trouble.
Check the precondition, then act. The S3 command was legitimate; the input was wrong. A runbook step that moves money states the condition under which it is safe and the check that proves it. Ferrowave’s restart is safe only when no batch is in state executing. That is not paperwork; it is the difference between resuming cleanly and paying 212 people twice.
Never re-create the thing to make it run. When a scheduled batch is stuck, the pull is to submit a fresh one with the same payouts. A new batch is a new batch, with new keys, and the customer’s staff are paid twice. Restart the executor and let it resume the batch that exists. This is the idempotency lesson (idempotency) applied at 02:10, and idempotency and exactly-once shows why Ferrowave requeries payouts left in sending and does not resend them.
Know what the key’s lifetime allows. Ferrowave keeps idempotency keys for 7 days. Schedules run up to 30 days ahead. The rule this chapter assumes is that a key lasts 7 days from a payout’s first attempt, not from the day the batch was submitted, so a batch whose first attempt is more than 7 days old needs a person who can read the ledger. Writing that rule into the runbook is the second half of designing it, which a design doc for one feature takes up.
This is why you build the runbook as the one who wrote the code. Nobody else knows the unsafe states. Payments incidents tells the story of an earlier Ferrowave retry that paid some payouts twice; the recovery steps in this chapter are shaped by it.
After the shift
The shift ends with three small jobs that decide whether the next night is better or the same.
Write the handoff note. Say what paged, what you did, what is still open and which silences you left in place. The incoming engineer reads it before taking the pager. If you were paged twice for the same lock timeout, say so: it is a pattern the next person would otherwise rediscover.
Fix the runbook while it is fresh. Any step that was wrong, missing or slow gets corrected in the same week. A runbook that you read once, find lacking and leave alone is a runbook that lets the next engineer find it lacking too. Ahunna, who held the pager the week before, left a note that the executor’s lock timeout had cleared itself twice; Adigun adds the stop sign for the case where it does not.
Open a ticket for the cause. The night page was for the symptom. The root cause is ordinary work, and it needs an owner and a date, or it comes back. The follow-through process for postmortem actions is the manager’s job to track, as the manager’s chapter describes; yours is to make the ticket specific.
If you were woken for something that did not need a human, say so in the pager review. A page that nobody should have received is a defect in the alert, and the person best placed to report it is the one who was woken.
Writing the runbook for your own service
A runbook is the document you wish you had at 02:10 and could not write then. Write it when you build the service, because you know the failure modes best at that moment, and keep it short enough to read half-asleep. The mechanics are in runbooks and on-call; the principles for your own service are these.
- One entry per alert. The entry has the same shape every time, so you do not have to learn the page while you are using it.
- Say what the alert means and who is hurt. One or two lines, with a number if you have one.
- Put the clock in. The deadline that makes the harm worse, in clock time.
- Give the checks before the steps. The checks tell you which state you are in; the steps assume you know.
- State each step’s precondition and its stop signs. If it is unsafe in some state, say which and say what to do then.
- Say when to escalate, and to whom. By time and by stop sign, with how to reach them.
- Say how you know it is fixed. A number on a dashboard, not a feeling.
- Say when it was last tried. A runbook step nobody has run in six months is a guess. Rehearse the restart in staging, as the production readiness review expects before a service takes real traffic.
Where practitioners disagree
Restart first or diagnose first. Some teams hold that a fast restart is the best first step for a stateless service, because it clears state and buys time. Others say it destroys evidence. For a stateless service with good logs, restart first is usually right; for one holding money in flight, the precondition decides.
How long to try alone. Twenty minutes is a common rule of thumb. Some teams use ten for tier 1 services and thirty for less urgent ones. What matters is that the number exists and is written down before the night.
Who should carry the pager. On-call done right covers the two models. At Ferrowave’s size it is “you build it, you run it”, which makes this chapter your job.
Heroics. Some engineers see fixing it alone as part of the job. Most teams that have lived through an unsupervised night disagree, and the postmortems agree with them.
Day to day
Carrying a pager is mostly quiet. The work is the preparation and the cadence.
At handover, fifteen minutes. Read the outgoing note, run the checks in the table above, send a test page to yourself. Confirm who your secondary is. At Ferrowave, handover is Wednesday at 10:00 (a new fact, illustrative), so the first minutes of your shift fall inside working hours.
Each morning of your shift, ten minutes. Look at last night’s pages, the due batches for the next 24 hours and any scheduled batches near the end of the month, because the 25th and the last working day carry most payroll. If a big day is coming, tell your secondary.
When a page arrives. Follow the first thirty minutes. Keep a running timeline in a note: time, what you saw, what you did. It costs nothing and becomes the postmortem’s first draft.
After a night page. Tell your manager, take the rest your company’s policy gives you, and write the handoff. Skip the 09:30 stand-up if you were up until 03:00; say so in the team channel.
Weekly, thirty minutes. The team’s pager review: every page last week, actionable or not, what to delete, what to fix. Bring the alerts that woke you.
Monthly. Read the runbook entries for the alerts that fired that month. Fix the ones that did not match reality, and rehearse one risky step in staging.
Whenever the service changes. A new feature adds failure modes, so it adds runbook entries. Scheduled payouts do not ship until the executor’s entries are written and the restart has been rehearsed.
There is no rota, only the engineers who built the system, and the pager rings on whoever is awake. Write a one-page runbook for the two or three alerts that matter and agree who is backup. Do not carry the pager alone for long: a single person on call is a single point of failure, and the person who built the system is the one who most needs a second opinion. Write down your stop signs on the day you build the thing, because by the time you have a second engineer the knowledge may be in one head.
This is where Ferrowave sits. A rota exists, often smaller than it should be, and engineers carry the pager for what their team built. Your tech lead is the escalation. Runbooks exist for some services and not others, and the first thing to do with a new feature is to write its entries before launch. Bring the rota arithmetic to planning. The proof that a four-person rota is too small is the number of weeks each person carries it.
The policy is written and the rota is large, but you may hold the pager for a service you did not build, with a runbook someone else wrote. Check its last rehearsal date, ask the owning team about its stop signs, and use the declared incident process early. Escalation crosses teams, so know how to page another team’s rota. When you did build it, you are the person the owning team calls, so your runbook needs to make that call unnecessary at night.
Template
# Runbook: <service>
Owner: <team> · Escalation: <secondary, tech lead> · Last rehearsed: <date>
Dashboard: <name> · Paging: <tier and acknowledge time>
## Alert: <name>
Means: <what is wrong, in one line>
Who is hurt: <who and how many>
Clock: <deadline in clock time, and the arithmetic>
### Check first
1. <what to look at, and what each answer means>
2. <the state that decides whether the steps are safe>
### Steps (stop at the first that works)
1. <step>. Safe when: <precondition>. Takes about <time>.
2. <step>. Safe when: <precondition>.
### Stop signs: do not continue, call <who>
- <state you do not recognise>
- <precondition fails>
- <any sign that money moved twice>
### Never
- <the tempting, unsafe action, and why>
### Escalate
After <n> minutes with no progress: page <secondary>.
Declare an incident when: <trigger>. Tell customer success: <what they need>.
### Fixed when
<observable result>
### Afterwards
Handoff note, ticket for the cause, update this entry. WORKED EXAMPLE
Ferrowave is a fictional bulk payouts company with 38 engineers. Payouts Core owns the scheduled-batch executor. Adigun, who built it, writes this entry before the January launch; the numbers are illustrative.
Runbook: scheduled-batch executor. Owner Payouts Core. Escalation: this week’s secondary, then Olaoluwa. Last rehearsed in staging on 10 December.
Alert: oldest due batch unclaimed for 10 minutes. Means the executor is not picking up batches that are due. Who is hurt: payroll customers whose staff expect pay; on a 25th, up to about 9,400 payouts in 31 batches. Clock: batches are due at 06:00 and customers have promised staff pay by 07:00. At about 3.5 payouts a second, 9,400 payouts take about 45 minutes, so the executor must be paying by 06:15.
Check first. (1) On the Scheduled payouts dashboard, is the count of due batches rising and the process up? (2) How many batches are in state executing? Zero means the steps below are safe. Any other number means stop.
Steps. (1) Clear the stale lock with the stale-lock job; takes one minute. Safe when no batch is executing. (2) Restart the executor from the deploy tool. Safe when no batch is executing. The unclaimed count should start to fall within three minutes.
Stop signs. A batch in executing. A payout count that differs between the console and the ledger. Any sign a payout was sent twice. Call the secondary.
Never. Re-create or re-submit a batch to make it run; it gets new keys and pays twice. Edit batch rows by hand.
Escalate. No progress after 20 minutes: page the secondary. Declare at 04:00 if the executor is still not paying. Tell Eloise, who looks after payroll customers, what is affected and when you will next update.
Fixed when unclaimed batches are zero, the oldest due batch is under two minutes old and the day’s scheduled and executed counts match.
Now you
You are Adigun. A second alert is about to be added to the executor runbook: more than 50 payouts have been in state sending for over 15 minutes. It happens when a partner bank’s connector, owned by Bank Connectors, times out and leaves payouts without a result. The batch stays in executing until every payout reaches a final state. You may requery payouts from the console, which asks the bank for the status of each by its reference and takes about 2 minutes for every 100 payouts. The answers are paid, failed or unknown. Resending a payout under its existing key within 7 days is safe; creating a new payout for the same person pays twice. A key lasts 7 days from a payout’s first attempt. Bank Connectors’ own on-call rota acknowledges within 15 minutes. In an earlier incident, 212 payouts sat in sending for 70 minutes. Complication: on the day you rehearse, 14 of the 212 requery as unknown. Customers can cancel a batch only until 30 minutes before it is due. Write the entry.
Self-check
You are Adigun, primary on call for Payouts Core, and it is 02:10 on Thursday 25 March. The scheduled-batch executor stopped claiming batches at 01:50. 31 batches, about 9,400 payouts, are due at 06:00, and customers have promised staff pay by 07:00. You have tried two things: confirmed the process is up and the queue is rising, and cleared the stale lock. Nothing changed. The runbook restart is safe only when no batch is executing; two are (separate from the 31), one at 212 of 300 payouts sent. Olaoluwa is this week's secondary. What do you do?
- BOOK Site Reliability Engineering, chapter 11: Being On-Call Andrea Spadaccini, ed. Kavita Guliani, 2016
The source for the 25% on-call limit used in the policy chapter, and a short account of how an on-call engineer is prepared and how on-call load is kept bounded. Read: Chapter 11, on what an on-call engineer is and the stress a rota must not create.
- BOOK The Site Reliability Workbook, chapter 8: On-Call Ollie Cook and others, 2018
A practical companion to chapter 11: example on-call setups, the limit of two incidents per shift and what to do when a team is overloaded. Read: Chapter 8, on-call setups inside and outside Google.
- HANDBOOK Being On-Call PagerDuty
A company's own published guide to what being on call means for the engineer, including the backup schedule that makes escalation routine.
- POST Summary of the Amazon S3 Service Disruption in the Northern Virginia (US-EAST-1) Region Amazon Web Services, 2017
A public account of an engineer's correct command with a wrong input. Read it for how a routine operational step can remove more than was meant.
- POST A Conversation with Werner Vogels Jim Gray, 2006
The interview where Amazon's CTO describes developers running what they build. It is where Vogels states the phrase this chapter starts from.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.