Vertical scaling: when a bigger checkout server helps 00:00:01 Four hundred checkouts still waiting Tickets go on sale at noon. Ten seconds later, four hundred more checkout requests are waiting. Mira, the engineer on call, watches the line grow. She’s considering vertical scaling, giving the same server more computing power. First, she checks two counters. Two hundred forty requests arrive every second. The busy checkout server finishes two hundred. If nobody gives up, forty more requests join the queue each second. Ten seconds of that gap explains the four hundred. What are they waiting for? 00:00:35 Find where the time goes Mira follows one checkout. It queues, checks ticket details, then asks the database to reserve a seat. The customer feels all three. The ninety-fifth percentile checkout time is creeping up. About ninety-five of every hundred requests finish within that time. Both virtual processors are busy, with runnable work queued behind them. A profile shows ten milliseconds of processor time per checkout. Database waits are short and memory pressure is low. Extra processors look worth testing. 00:01:07 Give the same worker more room The site sends requests to one checkout machine with two virtual processors. Mira picks a compatible size with four. Two independent checkouts fill the original pair. On the larger machine, two more can run beside them if the software has work ready. Same site, same checkout service, still one machine. Mira has scaled up. Follow one checkout by itself. A check that needs the result of the previous check still has to wait for it. 00:01:36 Price one second of processor time Take a simple model. Each checkout needs ten milliseconds of processor time. In a second, one fully occupied processor supplies a hundred slices. With independent requests, equal processors and no other delays, two could finish two hundred checkouts a second. Four could finish four hundred. Now hold demand steady at one hundred eighty a second. Those checkouts use one point eight processor-seconds each second. That’s ninety percent of two processors, or forty-five percent of four. That spare capacity can shorten the line. Halving utilization doesn’t tell us how much faster checkout feels. 00:02:16 When one seat lock sets the pace Try a different test. Everyone wants the same seat. The database grants one checkout at a time permission to update its record. Suppose each request holds that lock for ten milliseconds. The next request waits for its release. That lock admits at most one hundred such updates per second. Extra checkout processors can send more contenders. There’s still just one key. Other seats have independent locks in this example. That ceiling applies to updates competing for this one record. 00:02:49 One larger machine can still go away What if the checkout machine goes offline? All four processors disappear together. The ticket catalog might still load, but there’s no worker left to take a checkout. The larger machine bought capacity. It didn’t buy a spare. Scaling out would add another worker. A load balancer could send new requests to the healthy one if the other failed. That only helps if the surviving worker can handle the traffic and reach the reservation database. Mira tests that case separately. 00:03:22 Rehearse the interruption Before the next sale, Mira records a baseline for a repeatable test. Orders and reservations live outside the worker. For the change itself, she pauses new checkouts and lets in-flight requests finish. With just one worker, the team plans for an interruption. On this Amazon instance backed by an E B S volume, she stops the machine, changes its type and restarts. Health checks pass. She reopens checkout. She replays the same traffic and compares completions, errors and ninety-fifth percentile time. If errors rise or the slow tail worsens, she pauses checkout and restores the previous size. 00:04:04 Would another upgrade help? At the next rehearsal, checkout slows again. Processor use is thirty-five percent, and the database reports long lock waits. What would you investigate first? Mira opens the database wait trace. She checks which seat records are contested and which transactions keep the lock longest. Her rule is to find the queue, identify what serves it, then change that resource and measure again. Those four hundred waiting requests measured the growing line. Following one checkout showed Mira where to fix it.