KAHIBARO
Discord Login Register

Vertical Scaling

Understanding Vertical Scaling

Vertical scaling is about making a single server more powerful so it can handle more work. Instead of adding more machines, you upgrade the one you already have.

In this chapter you will see what vertical scaling is, how it compares to horizontal scaling, when it works well, and what limits it in real applications.

What Is Vertical Scaling?

Vertical scaling means increasing the capacity of one node.

Typical ways to scale vertically:

In cloud environments, vertical scaling usually means:

You still have one application instance or one database instance, only bigger.

Vertical vs Horizontal Scaling

You learn about horizontal scaling in another chapter. Here is the focused comparison:

AspectVertical scalingHorizontal scaling
Basic ideaMake one machine biggerAdd more machines
Number of instancesStays 1Grows (2, 3, 10, 100, …)
Implementation effortUsually simple (change instance size)Requires more architecture work
Typical limitsHardware limit of one machineCoordination and network complexity
Good forEarly growth, databases, simple appsLarge scale, high availability, big traffic
Downtime riskOften requires restart or maintenance windowNew nodes can be added with less disruption
Cost behaviorOften grows nonlinearly with sizeMore linear, but adds operational overhead

Vertical scaling is usually the first step when your application hits resource limits, especially for:

When Vertical Scaling Works Well

Vertical scaling is very effective in several common situations.

1. Early Stage or Simple Architecture

When you have:

you can often handle a lot more load by just:

Example:

No code changes, no new infrastructure components.

2. CPU-Bound Workloads

If your backend spends most time doing CPU work, for example:

then more CPU and better single-core performance can help a lot.

Example:

3. Memory-Bound Workloads

Some workloads are limited by RAM:

If processes are constantly killed by the OS because of out-of-memory, or your database is swapping to disk, adding RAM can dramatically increase performance.

Example:

4. Databases and State

Databases are often the hardest component to scale horizontally. Vertical scaling is a natural first strategy:

For many products databases can run for a long time on a single powerful machine before horizontal scaling is necessary.

Practical Example: Scaling a Simple API

Imagine a FastAPI application running on one server.

Initial server:

Traffic grows, and you see:

Without changing your code you:

After the upgrade:

You did vertical scaling. The process was:

  1. Observe metrics
  2. Identify the bottleneck (CPU in this case)
  3. Increase the relevant resource
  4. Observe again

This pattern is common early in a project.

How to Decide Whether to Scale Vertically

You should always base scaling decisions on measurements, not guesses.

Useful metrics:

ComponentMetric examplesVertical scaling signal
CPUAverage CPU usage, per-core usageSustained > 70–80% for long periods
MemoryMemory usage, swap usage, OOM errorsFrequent swapping, OOM kills, high page faults
DiskDisk I/O wait, IOPS, disk latencyHigh I/O wait time, slow reads/writes
NetworkNetwork throughput, dropped packetsConstantly at or near NIC limits
DatabaseBuffer cache hit ratio, slow queriesLow cache hit ratio, heavy I/O, CPU-bound queries

A simple decision process:

  1. Identify where the bottleneck is
  2. Check if a bigger instance can reduce that bottleneck
  3. Estimate cost vs. benefit
  4. Plan and execute the upgrade, including a rollback plan

Important rule: Always profile and measure first, then scale. Do not scale vertically based on intuition alone.

Benefits of Vertical Scaling

Vertical scaling has several strong advantages:

Simplicity

Fast to Apply

In many cloud providers:

Managed databases often offer a one-click or automated upscale.

No Code Changes Required

Most of the time, you get benefits just by:

Your application architecture can remain the same.

Good for Single-Node Stateful Systems

For:

vertical scaling avoids the complexity of clustering or sharding for as long as possible.

Limits of Vertical Scaling

Vertical scaling is powerful, but it has hard and soft limits.

Hard Limits

You cannot keep growing a single machine forever.

Examples:

At some point, there is simply no bigger machine.

Diminishing Returns

Even before you hit hard limits, returns can become worse.

Reasons:

For example:

Downtime Risk

Changing instance size often requires:

For production systems, this means:

You can reduce downtime with techniques like blue/green deployments, but that is more complex.

Cost Behavior

Vertical scaling often has non-linear cost:

Example:

Instance typevCPUsRAMPrice (relative)
Small24GB1x
Medium48GB2.4x
Large816GB5.5x

So 4x capacity might cost more than 4x money.

Single Point of Failure

One big machine is still one machine.

If that machine:

your whole system goes down.

Horizontal scaling helps with high availability. Vertical scaling alone cannot.

Important statement: Vertical scaling alone cannot give high availability. You still have a single point of failure.

Vertical Scaling and Performance Types

You learned about CPU-bound and I/O-bound work in another chapter. Vertical scaling interacts with them in different ways.

CPU-Bound Work

Vertical scaling helps by:

Example:

If your application server can use multiple processes or threads, more cores usually mean more throughput.

I/O-Bound Work

Vertical scaling helps mostly by:

Example:

Here, even if CPU is not the limit, better hardware makes each I/O operation faster.

How to Scale Vertically in Practice

Even though every provider is different, there are common patterns.

Scaling an Application Server

Steps usually include:

  1. Check metrics
    • CPU, memory, load average, response times
  2. Choose a bigger instance
    • More vCPUs
    • More RAM
  3. Plan the upgrade
    • Off-peak time if you expect downtime
    • Backup important data (logs, configurations)
  4. Upgrade
    • Resize instance or create a new bigger one and move traffic
  5. Verify
    • Check metrics after upgrade
    • Run smoke tests on critical endpoints

You might also adjust application settings:

Scaling a Database Vertically

Typical steps:

  1. Analyze database performance
    • Slow queries
    • Buffer cache hit ratio
    • CPU and disk usage
  2. Try optimizations first
    • Indexes
    • Query optimization
    • Configuration tuning
  3. If still constrained, increase instance size
  4. Monitor after upgrade
    • Verify that performance actually improved

It is common to:

Combining Vertical and Horizontal Scaling

Vertical and horizontal scaling are not enemies. You often use both over time.

Typical growth path:

  1. Small instance, simple app
  2. Vertically scale:
    • Bigger app server
    • Bigger database instance
  3. When vertical scaling becomes too expensive or reaches limits:
    • Add more app servers behind a load balancer
    • Use read replicas for the database
    • Move some responsibilities to other services

Vertical scaling often comes first because it is:

Later, you add horizontal scaling for:

Rules of Thumb for Vertical Scaling

You can treat these as practical guidelines.

Rules of thumb:

  1. Use vertical scaling first for simple systems until costs or technical limits make it unreasonable.
  2. Always measure bottlenecks before scaling, and validate after scaling.
  3. Do not rely on vertical scaling for high availability, use redundancy and horizontal strategies for that.
  4. Optimize software and queries before or alongside buying bigger hardware.

Applied examples:

Summary

Vertical scaling is about making your existing server more powerful by upgrading CPU, memory, disk, or network. It is:

As a backend developer you should:

You will see how vertical scaling compares to horizontal scaling and how to design for large scale in the surrounding chapters on performance and scalability.

Views: 6

Comments

Please login to add a comment.

Don't have an account? Register now!