02 / 25 · Traffic and capacity

Auto scaling

Auto scaling changes capacity automatically when measured demand changes. A controller observes a signal, chooses a replica count and waits for new capacity to become ready. It is a delayed feedback loop, not instant unlimited capacity.

What you will practise

  • Identify a useful scaling signal
  • explain startup delay
  • check downstream limits

Before you start: Replica, CPU usage and readiness.

About 5 minutes · offline-generated English female narration · captions included. Diagrams are conceptual; timings are illustrative.

Download MP4Captions

Listen without the videoDownload audio

The same pre-recorded voice as the video. Starting audio pauses the video, and starting the video pauses audio.

Chapters and full transcript

Let us understand auto scaling. A shop manager sees a long checkout queue and opens another counter. Opening takes time: someone must arrive, sign in and prepare the till. Closing every quiet counter immediately would cause a new queue a minute later. The manager needs minimum staffing and patience, not just a rule that reacts to every small change. Auto scaling changes capacity automatically when measured demand changes. A controller observes a signal, chooses a replica count and waits for new capacity to become ready. It is a delayed feedback loop, not instant unlimited capacity.

Follow the normal path. The application serves visitors while metrics record utilization and request behavior. Select a signal related to the constrained resource, not simply the easiest chart. The controller compares the observed signal with a configured target and computes a desired replica count within minimum and maximum limits. SeatSpot traffic grows before a popular sale. Manual scaling may arrive too late, while leaving peak capacity running all day wastes resources. Automatic control can help, provided start-up delay and dependency limits are included.

Now change one condition. The controller requests more replicas. Scheduling, image download, initialization and health checks take time. Desired capacity and ready capacity can differ. A common misunderstanding is this: Automatic scaling is instant. Observation, scheduling, image startup and readiness all take time. Think about this. CPU is low while requests wait on a database. Should CPU scaling be your only signal? Pause the video and make your prediction. No. CPU can be low during I/O waits. Inspect latency, concurrency, database waits and the actual constrained resource.

Let us reason with a concrete example. Four replicas average 80% CPU. The target is 50%, assuming similar replicas and CPU-bound work. A simplified estimate is ceil(4 × 80 / 50) = 7 replicas. This is a teaching estimate; real controllers apply tolerances, readiness handling and other policies. Check whether seven replicas can start, whether their total database connections fit, and whether latency improves. A replica recommendation is not proof the system is safe. These figures are teaching examples, not production guarantees.

Turn the idea into a design decision. Only ready replicas should receive normal traffic. If nodes or quotas are exhausted, a controller cannot create the missing physical capacity by itself. More application copies can increase database connections. Limit aggregate concurrency so solving an application bottleneck does not create a database outage. When you try the practice task, look for this result. Seven is a simplified recommendation, not seven instantly ready or safe servers.

Check your understanding. After demand falls, stabilization prevents rapid shrinking and regrowth. Drain work before removing replicas and keep enough minimum capacity for the next burst. Here is a challenge. A queue receives 120 jobs/second. Each worker handles 20. How many workers stop backlog growth, and why might you need more? Pause before the answer. Six workers match the average under ideal assumptions. More are needed to drain existing backlog and tolerate failures or variable duration, within downstream safety limits. Monitor oldest-job age, not just queue size. For an interview, choose metrics, minimums, maximums and stabilization. Say what you would measure, not only which tool you would buy.

Start with an everyday picture

A shop manager sees a long checkout queue and opens another counter. Opening takes time: someone must arrive, sign in and prepare the till. Closing every quiet counter immediately would cause a new queue a minute later. The manager needs minimum staffing and patience, not just a rule that reacts to every small change.

Why SeatSpot needs this

SeatSpot traffic grows before a popular sale. Manual scaling may arrive too late, while leaving peak capacity running all day wastes resources. Automatic control can help, provided start-up delay and dependency limits are included.

Trace one step at a time

Move through the diagram at your pace. Teal paths are active; unavailable components are labelled.

RequestsMetric collectorControllerApp replicasDatabase

Step 1 of 6 · Current replicas: 4

Observe demand

The application serves visitors while metrics record utilization and request behavior. Select a signal related to the constrained resource, not simply the easiest chart.

Read all six mechanism steps
  1. Observe demand

    The application serves visitors while metrics record utilization and request behavior. Select a signal related to the constrained resource, not simply the easiest chart.

  2. Choose a target

    The controller compares the observed signal with a configured target and computes a desired replica count within minimum and maximum limits.

  3. Request capacity

    The controller requests more replicas. Scheduling, image download, initialization and health checks take time. Desired capacity and ready capacity can differ.

  4. Wait for readiness

    Only ready replicas should receive normal traffic. If nodes or quotas are exhausted, a controller cannot create the missing physical capacity by itself.

  5. Check dependencies

    More application copies can increase database connections. Limit aggregate concurrency so solving an application bottleneck does not create a database outage.

  6. Scale down carefully

    After demand falls, stabilization prevents rapid shrinking and regrowth. Drain work before removing replicas and keep enough minimum capacity for the next burst.

Pause and make a prediction

CPU is low while requests wait on a database. Should CPU scaling be your only signal?

Answer aloud or write your reasoning in the lesson notes before revealing the explanation.

Correct a common misunderstanding

Claim to question: Automatic scaling is instant.

Better explanation: Observation, scheduling, image startup and readiness all take time.

Work a scaling recommendation

A paper or whiteboard task. No cloud account or paid infrastructure is required.

  1. Start with four replicas at 80% CPU and a 50% target.
  2. Calculate 4 × 80 / 50 and round up.
  3. List startup time, cluster quota and database-connection limits.

Check what you can explain

This is your self-check, not an automated grade. Try again without the diagram tomorrow.

0 of 3 goals checked. Choose one remaining idea to practise next.

These checkboxes reset when you leave. Use your saved lesson notes and completion marker to record lasting progress.

Teach it back

Without looking, explain what this component changes, what it does not solve and what happens if it fails. Use the animation to check your explanation, then switch to Engineering.

Try it before viewing the solution

A queue receives 120 jobs/second. Each worker handles 20. How many workers stop backlog growth, and why might you need more?

Check one key idea

What does adding application replicas guarantee?

Your explanation and interview notes

Saved only in this browser when storage is available. Export a backup from the course page before clearing browser data or moving devices.

Loading your local notes…

Official references and next reading

The explanation, fictional examples and animations are original teaching material. Vendor behavior depends on the specific product/version; use its documentation before deploying.