Vertical Scaling
Definition
Scaling
- In plain English
- Scaling is changing a system so it can handle more work.
- Think of it like
- It is like adding tables to a restaurant when more diners arrive.
Vertical scaling
- In plain English
- Vertical scaling means making one machine more powerful with more processors, more memory or faster disks.
- Think of it like
- It is like swapping your hatchback for a bigger van instead of buying a second car.
Stateless service
- In plain English
- A stateless service keeps no user-specific memory between requests, so any copy can handle any request.
- Think of it like
- It is like a bank where any teller can help you because your details live in the shared system, not in one teller's head.
Single point of failure
- In plain English
- A single point of failure is one part whose breakdown stops the whole system.
- Think of it like
- It is like an old string of fairy lights where one dead bulb turns off the whole string.
Why it exists
Your database slows during lunch because its memory is full. A larger machine gives it more room.
You keep one server to manage. For many early products, this is the quickest useful upgrade.
How it works
Bottleneck
- In plain English
- A bottleneck is the one part that limits how fast the whole system can go.
- Think of it like
- Like the narrow neck of a bottle that slows the pour.
Working set
- In plain English
- The working set is the data a program touches often enough that it should fit in memory.
- Think of it like
- Like the books you keep on your desk instead of in the basement.
CDN
- In plain English
- A CDN is a network of servers that delivers copies of content from locations near users.
- Think of it like
- It is like keeping the same leaflet at many local branches.
- Find the limit
Check processor use, memory use and time waiting for disk reads.
- Choose an upgrade
Buy more of the resource that limits your work.
- Move or restart
Plan the interruption before moving to the bigger machine.
- Measure again
Compare latency and throughput under the same amount of work.
| Symptom | Upgrade to consider |
|---|---|
| Processor busy almost all the time | More processing cores for work that runs at the same time |
| Frequently used data exceeds memory | More memory |
| Slow disk reads | Faster solid-state storage, called an SSD |
A server with four processing cores and 16 GB of memory becomes one with 64 cores and 512 GB.
Examples
Keep common records in memory
The inventory database holds 40 GB of data but has 8 GB of memory. Measured common queries improve about tenfold after a 64 GB upgrade.
Before the upgrade, common queries repeatedly read slower disks. Afterward, the working set fits in memory.
- Check which records are accessed often.
- Measure the improvement rather than promising tenfold gains everywhere.
The insight
Fitting the working set in memory makes a targeted upgrade valuable.
Keep orders in sequence
A matching engine pairs buy and sell orders. For this example, one ordered stream must be processed in exact sequence.
A faster processor shortens each step in that stream. Extra cores do not automatically speed up work performed one step at a time.
Orders enter one matching engine running on a fast processor, then leave as completed trades.
The insight
Some work is difficult to divide across machines.
Find the upgrade ceiling
The monitoring server reaches 100% processor use. The next size costs twice as much for 1.6 times the capacity.
Three new farms will need three times today’s capacity. Even the largest available size in this example falls short.
Size Monthly cost Relative capacity
Small GBP 100 1.0
Medium GBP 200 1.6
Large GBP 400 2.5
Next year required 3.0The insight
A larger machine buys time until growth exceeds available sizes.
Trade-offs
Pros
- Usually needs few application changes.
- Keep one machine to manage.
- Avoid dividing data across servers.
Cons
- Machine sizes have a ceiling.
- Higher sizes often cost more per unit of work.
- One failure still stops service.
- Resizing often interrupts service.
Use when
- Relieve a measured resource limit.
- Grow an early product with modest demand.
Avoid when
- Avoid relying on one machine when outages are costly.
- Avoid it when growth exceeds the largest size.
Quick check
Takeaways
- Vertical scaling means a bigger machine.
- Upgrade the resource that limits useful work.
- One large machine still has a capacity ceiling and a failure risk.