Autoscaling
0-day streakReview

Your progress

Level 1

0 XP100 XP to level 2
0day streak
0best streak
0topics started
0cards reviewed
    Review cards

    Progress is stored only in this browser. No account is required.

    Layer 3 · Go deeper · 7 min

    Go deeper

    Size it, build it, then make the calls an interviewer will push you on.

    Back of the envelope

    Size it up

    Tap through each step of the arithmetic.

    How much does following demand save over sizing for the peak?

      How hard can today’s fleet run while new capacity is on its way?

        How many workers does a 30-second delivery promise need?

          Build-up · 6 steps

          Follow one load jump to a serving pod

          The HPA, metrics-server and Cluster Autoscaler at their defaults, with illustrative image and warm-up times. Six pods sit at 90% CPU against a 60% target.

          Step 1 of 6

          Load jumps; the metric lags

          The pods are already at 90% CPU, but nothing knows until the next scrape. metrics-server scrapes every 15 seconds, so the HPA may not see it for up to 15 s.

          4 interview moments

          You’re the candidate

          The interviewer pushes on the hard parts. Pick an approach and see how it holds up.

          1. Deep dive 1 of 4

            Interviewer

            “Your API mostly waits on the database: 400 requests/s per pod at 50 ms each. What do you autoscale it on?”

            Your move. Pick an approach:

          2. Deep dive 2 of 4

            Interviewer

            “A notification service promises delivery within 30 seconds, and one worker sends 50 messages a second. What do the workers scale on?”

            Your move. Pick an approach:

          3. Deep dive 3 of 4

            Interviewer

            “Your booking site’s tatkal window opens at 10:00, and the rush arrives faster than any reactive loop. How do you prepare?”

            Say the forecast peak is 60,000 requests/s, one pod holds p99 under 300 ms up to 300 requests/s, and you target 70%.

            Your move. Pick an approach:

          4. Deep dive 4 of 4

            Interviewer

            “Each checkout pod opens 20 database connections, and the database allows 500. What do you set as the autoscaler’s max?”

            The database slows, pods hold requests longer, CPU and in-flight requests climb, and the autoscaler starts adding pods.

            Your move. Pick an approach: