Quick revision
The short answer
In the first minutes I protect the core: turn on load shedding at the edge so the backend admits only what it can serve, cut work per request with degradation flags, longer cache TTLs and CDN-served landing pages, and add capacity past the autoscaler's limits while watching database connections. I keep the incident channel and marketing informed and give the sign-up path priority over browsing. Before the next advertisement, we get the schedule, pre-scale 30 minutes before air time, load test landing and sign-up at the expected peak, serve landing pages statically and size pools and the database for the pre-scaled fleet.
What to remember
In this answer, we responded to a twentyfold spike from a television advertisement. In the first minutes we protected the core with load shedding at the edge, cut work per request with degradation flags, longer TTLs and CDN-served landing pages, and added pods only as far as the database connections allowed, while keeping marketing informed and giving sign-up priority. For the next airing we get the schedule, pre-scale 30 minutes ahead, load test landing and sign-up at the expected peak, serve landing pages statically, and size pools and the database for the larger fleet.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
In the first minutes I protect the core: turn on load shedding at the edge so the backend admits only what it can serve, cut work per request with degradation flags, longer cache TTLs and CDN-served landing pages, and add capacity past the autoscaler's limits while watching database connections. I keep the incident channel and marketing informed and give the sign-up path priority over browsing. Before the next advertisement, we get the schedule, pre-scale 30 minutes before air time, load test landing and sign-up at the expected peak, serve landing pages statically and size pools and the database for the pre-scaled fleet.
Why this question is asked
A twentyfold spike in 90 seconds is exactly what a television advertisement produces: everyone watching picks up their phone at once. It is also one of the most expensive outages a company can have, because the company has just paid for millions of people to visit, and they meet errors. Interviewers ask this scenario to see whether an on-call engineer protects the system in the right order instead of reaching only for more servers. In this answer, we will look at the state of the system, act in the first minutes, run the incident, and then prepare for the next advertisement.
1A Quick Recap of Where We Stand
Traffic went from 2,000 to 40,000 requests per second in 90 seconds. Autoscaling needs about 4 minutes to add pods, and even then the new pods will be cold. The database is at 90 percent CPU, which means queries are queuing, and the error rate is 35 percent.
Two facts shape the response. First, the database is the real bottleneck: more application pods would send even more queries to it. Second, at 35 percent errors, many clients are retrying, so part of the 40,000 is our own failures coming back. If the database collapses, the error rate goes to 100 percent and recovery takes much longer. So the priority is to stop the overload, not to serve everyone.
2Minutes 0 to 5: Protect the Core
The first action is admission control at the edge. We tighten the rate limit at the gateway or CDN so the backend admits only about what it can serve well, perhaps 8,000 to 10,000 requests per second, and everything above gets a fast 503 with Retry-After or a friendly busy page. Rejecting 75 percent of requests quickly sounds drastic, but it lets the admitted 25 percent succeed, and it stops retries from piling on.
In parallel we cut work per request with degradation flags prepared for this: recommendations, live counters and personalised content off. We raise cache TTLs so more reads are served from cache, and serve the landing pages straight from the CDN. Each of these reduces database load within seconds, without waiting for any new capacity.
- Shed load at the edgeadmit what the backend can serve, fast 503 for the rest
- Switch on degradation flagsrecommendations, counters, personalisation off
- Serve landing pages from the CDN, raise TTLsdatabase reads drop
- Scale pods past autoscaler stepscheck total database connections first
- Database stable and errors falling?YesRaise the admission limit step by stepNoShed more and keep degrading
- Prioritise sign-up over browsingthe goal of the advertisement
6 steps in order. Play them, or step through them one at a time.
3Adding Capacity Without Hurting the Database
Capacity still helps, but only where the bottleneck is not. We scale the application past the autoscaler's step limits, which usually add a few pods at a time, by setting the desired replica count directly. But before we do, we check the arithmetic of connections. If each pod has a pool of 20 database connections, going from 20 pods to 80 adds 1,200 connections, and a PostgreSQL server with max_connections at 500 will refuse them, or will slow down further from the overhead. A connection pooler such as PgBouncer, or smaller pools per pod, keeps the total within what the database can take.
If the database has read replicas, moving read-only queries to them, if the code supports it, relieves the primary. Scaling the database primary itself is usually too slow and risky to do in the middle of the spike.
4Running the Incident
While acting, we keep an incident channel with regular short updates, and we tell marketing what is happening: they may want to change the call to action on social media, and they need to know before the next airing. If the goal of the advertisement is sign-ups, the sign-up path gets priority over browsing: admission control can admit sign-up requests first and shed anonymous browsing first, and the landing page can lead directly to sign-up.
As the spike subsides, usually within 10 to 20 minutes of the airing, we raise the admission limit step by step, watching database CPU, and turn features back on one at a time.
5Before the Next Advertisement
The deepest fix is organisational: get the airing schedule from marketing, with expected audience sizes, so the platform team knows every spike in advance. With the schedule, we pre-scale 30 minutes before air time, so pods are warm and caches are filled, instead of relying on an autoscaler that reacts 4 minutes late.
We load test the landing and sign-up paths at the expected peak plus a margin, which tells us where the next bottleneck is. Landing pages become static and served by the CDN, so most of the spike never reaches our servers. Connection pools and the database are sized for the pre-scaled fleet, with a pooler in front if needed. And the admission limits and degradation flags are configured and rehearsed before the airing, so on the night they are a switch, not a scramble.
| Area | This airing | Next airing |
|---|---|---|
| Capacity | Autoscaler reacts 4 minutes late | Pre-scaled and warm 30 minutes before |
| Landing pages | Rendered by the backend | Static, served by the CDN |
| Database | 90 percent CPU, pools unbounded | Sized for the fleet, pooler in front |
| Overload protection | Added during the incident | Admission limits and flags ready |
| Knowledge of the spike | None | Airing schedule from marketing |
6Follow-up questions
How would you estimate the expected peak from the size of the advertisement's audience?
Start from data: what fraction of the audience acted within the first few minutes of past airings. For example, if 3 million people watch, and past airings show 1 percent open the app within the first 2 minutes, that is 30,000 users in 120 seconds. If each session makes about 20 requests in its first minute, that is around 10,000 requests per second from new sessions, on top of normal traffic and retries. Without history we use industry numbers from marketing, measure the first airing carefully, and plan the next ones with a generous margin such as two times the estimate.
Why not just let the autoscaler handle it with more aggressive settings?
Because the spike reaches its peak in 90 seconds and the autoscaler needs about 4 minutes, and new pods are cold when they arrive. More aggressive settings also cannot scale the database. A known spike should be met with pre-scaling, not reaction.
Is it acceptable to show some users a busy page?
Yes, during an overload it is the best option available. A fast busy page with a retry time keeps the system working for the users admitted, while the alternative, admitting everyone, makes every request slow and most of them fail.
7Conclusion
In this answer, we responded to a twentyfold spike from a television advertisement. In the first minutes we protected the core with load shedding at the edge, cut work per request with degradation flags, longer TTLs and CDN-served landing pages, and added pods only as far as the database connections allowed, while keeping marketing informed and giving sign-up priority. For the next airing we get the schedule, pre-scale 30 minutes ahead, load test landing and sign-up at the expected peak, serve landing pages statically, and size pools and the database for the larger fleet.
Open with
With the database at 90 percent and 35 percent errors, my first priority is to stop the overload, because if the database collapses everything fails and recovery is slower.
Then, if they want more
So I turn on load shedding at the edge, admitting only what the backend can serve well and returning fast 503s with Retry-After for the rest. In parallel I switch on degradation flags, turning off recommendations, live counters and personalisation, raise cache TTLs and serve landing pages from the CDN, which cuts database load within seconds.
Then I add capacity past the autoscaler's step limits, but only after checking that more pods will not open more database connections than it can take. I keep the incident channel and marketing updated, and if the advertisement is about sign-ups, sign-up gets priority over browsing. As the spike passes, I raise the limit step by step.
Before the next advertisement, I want the airing schedule from marketing, pre-scaling about 30 minutes before air time so pods and caches are warm, load tests of the landing and sign-up paths at the expected peak, static landing pages on the CDN, and pools and the database sized for the pre-scaled fleet, with the shedding limits and flags ready in advance.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "You are on call. What do you do in the next 15 minutes, and what do you change before...": https://scrivio-interview-library.netlify.app/architecture/high-availability/78c530d595/