Skip to content

Vertical scaling triggers — when CPU/RAM ceilings are the right signal, and when latency is

CPU at 90% is not automatically a reason to resize. The signal you scale on determines whether you fix the bottleneck or just spend more cloudlets on the wrong layer.

The on-call channel pings at 14:07 with “Postgres node at 92% CPU.” A junior engineer with the right intentions opens the Jelastic console and bumps the cloudlets from 32 to 48. The CPU drops to 60%. Latency on the application — which was the actual user-visible problem — doesn’t move. Twenty minutes later the same alert fires again because the actual bottleneck was lock contention on a single hot row, and giving the box more CPU just let it work harder at waiting. The trigger was a number; the fix should have been a question.

What’s happening

Vertical scale is the right answer when the resource at the ceiling is the resource the work needs. It’s the wrong answer when the ceiling number is a symptom of a constraint elsewhere — usually I/O, locks, or downstream blocking. There are exactly four signals where vertical resize is the correct mechanical fix:

  • Memory is tight and the application is paging or OOM-killing. dmesg shows the OOM killer, swap is being used, or the JVM is spending more time in GC than in handling requests. Adding RAM directly relieves the pressure.
  • Single-thread CPU is saturated and the workload can’t be parallelized. A pg_dump, a long aggregation, a single-threaded import — top shows one core at 100% and the rest at 5%. A faster CPU per core (more cloudlets, denser silicon) helps. More nodes don’t.
  • Disk I/O is the constraint and the PaaS scales IOPS with size. On Jelastic, storage IOPS often scales with the cloudlet count of the node. If iostat shows queue depth > 1 and await > 10ms sustained, vertical scaling buys you IOPS.
  • The workload is genuinely stateful and a second node introduces consistency complexity you don’t want. A Postgres primary, a single Redis cache, a Solr master — adding a node here is “build a cluster,” not “scale up.”

The trap is treating CPU% on a stateless app tier as a vertical scaling trigger. CPU% on the application tier is almost always a horizontal-scaling signal — more workers, more nodes — because the latency users care about is queueing latency, and queueing latency is fixed by adding parallelism, not by making each handler faster.

How to verify

Three checks distinguish “vertical is the fix” from “vertical is the wrong fix”:

# 1. Is the CPU pinned on one core or spread across all of them?
mpstat -P ALL 2 5
# If %usr is 100 on CPU0 and 5 on CPU1..N, it's single-thread.
# Vertical scaling (faster per-core) helps. Horizontal does not.

# 2. Is disk waiting?
iostat -xz 2 5
# %iowait > 20, await > 10ms, aqu-sz > 1 — disk is the bottleneck.
# On Jelastic, IOPS scale with cloudlet count, so vertical helps.

# 3. Is the application waiting on locks or downstream services?
SELECT pid, now() - query_start AS dur, wait_event_type, wait_event, query
  FROM pg_stat_activity
 WHERE state != 'idle'
 ORDER BY dur DESC LIMIT 20;
# If most active queries show wait_event_type = 'Lock' or 'IO',
# more CPU on the box does nothing. Fix the lock or the query first.

If two and three are clean and one shows single-thread saturation, vertical is correct. If three shows lock waits or external HTTP waits, no amount of resize will help — that’s a code or architecture fix.

The fix

Two rules for picking vertical:

  1. Define the bottleneck before the resize, not after. Run mpstat, iostat, and a query/wait-state check inside five minutes of the alert firing. If you can’t say “the bottleneck is X” in plain words, you’re not ready to resize — you’re guessing.
  2. Resize in one ratio, observe, then resize again. Jumping from 16 to 64 cloudlets to “fix it once” hides what was actually fixing it. Double the cloudlets, give the workload ten minutes to settle, then check the same three signals. If they didn’t move, the bottleneck wasn’t where you thought.

If the resize playbook is being run by gut feel because nobody owns the scaling matrix for your stack, our Cloud PaaS team writes it per layer and runs the response under environment management — start a scoping call.