Slow by Monday, no deploy
Step 1 · The pattern
Friday evening: shipped and fast
A new activity page goes live at 18:00. Every action a user takes adds a row to a new table, and the page reads from it. The table holds 20,000 rows, each query is quick, and the deploy is marked healthy.
- served
- on its way
In short
Slow by Monday, no deploy: how it works and how it breaks
Some changes do not fail when they ship. Their cost depends on something that grows afterwards: rows in a new table, entries in a cache, files on a disk, messages in a backlog. On the day of the deploy that amount is small and the change looks free. Then the amount grows, so each request costs a little more every hour. The weekend is quiet, so nothing is busy enough to show it. The failure arrives with the next peak, when a higher cost per request meets full traffic. By then the deploy is days old. The on-call engineer checks for recent changes, finds none, and looks elsewhere. To catch it, ask what has been growing since the last healthy peak. To prevent it, test a change at the data size it will have in a month.
What this simulation simplifies
- The table's size is fixed within each step. In reality it grows continuously and each query is a little slower than the one before.
- Only the new page is shown. A saturated database also slows every other feature that shares it, which is why everything is slow.
How this comes up in interviews
"A feature went out on Friday evening. On Monday morning everything is slow, and no code has changed since. What happened, and how do you find it?"
Then they ask
- Which kinds of change cost more over time without any further deploy?
- Why did nothing alert over the weekend?
- How would you change the release process so that this is caught before the peak?
A strong answer covers
- The Friday change is the last change. Its age does not clear it.
- Its cost depends on something that grows: rows, cache entries, memory, disk or a backlog.
- Low weekend traffic hid the rising cost per request. Monday's peak multiplied it.
- Compare one request's cost now with a week ago: rows read, query time, memory per request.
- Prevent it by testing at future data size and judging a release after a full peak.
Points to cover, not a script. Say them in your own words and tie them to a system you have worked on.
On one page: the track cheat sheet.
Sources: Google SRE book: Effective Troubleshooting (what touched it last) ↗ · PostgreSQL documentation: Indexes, introduction ↗ · Google SRE workbook: Canarying Releases ↗ · Report a problem
Diagrams are our own simulations: the timings, rates and counts in them are illustrative, not measurements. Captions are original wording.