What scale-up (vertical scaling) means — and its drawbacks
Vertical scaling is upgrading a single server (more CPU, RAM, or a bigger VM/instance). It’s easy to understand, but it has three important limitations:- Hard ceiling: a single machine can only go so far before you hit maximum instance sizes or physical limits.
- Single point of failure: if that one machine fails, the whole service can go down.
- Downtime / disruption: resizing hardware or a VM often requires downtime or causes degraded performance during the change.
What scale-out (horizontal scaling) means — and common pitfalls
Horizontal scaling is adding more servers (instances) and distributing load across them. It sounds like the safer approach, but it also introduces complexity:- In-memory sessions can break when a user is routed to a different instance.
- Files written to local disk won’t be available on other instances unless you use shared storage.
- Adding nodes without addressing state, consistency, and orchestration can create new failure modes.
Quick comparison
A practical three-step approach
Rather than reflexively adding CPU, follow this sequence:- Diagnose before you scale
- Identify what is actually consuming CPU: a runaway process, a bad SQL query, GC churn, or system bottleneck?
- Scaling hides bugs; it doesn’t fix them. If a specific query is monopolizing CPU, adding hardware only delays the problem.
htop— interactive process viewerps -eo pid,cmd,%cpu,%mem --sort=-%cpu | head— find top CPU consumers- Database slow query logs and
EXPLAINplans - Application tracing / APM (e.g., Jaeger, Zipkin, Datadog, New Relic)
- OS-level metrics: load average, context switches, I/O wait
- Make your application stateless
- Move session storage out of process memory into a shared store (for example, Redis or Memcached).
- Use object storage (e.g., AWS S3) or a network file system for uploaded files rather than local disk.
- Ensure any instance can handle any request without relying on local in-memory state.
- Use sticky session avoidance; store auth tokens or session IDs in a shared backend.
- Use object or CDN-backed storage for static assets and user uploads.
- Instrument the app for metrics and tracing to observe cross-instance behavior.
- Scale horizontally — autoscaling behind a load balancer
- With a stateless application, place instances behind a load balancer and configure autoscaling.
- Example autoscaling policy: add instances when average CPU across the fleet exceeds 70%; scale down when it drops below 30%. Include cooldown windows and max/min instance limits.
- Implement health checks and graceful termination so in-flight requests complete when instances are removed.
- Proper health checks (HTTP 200, readiness/liveness endpoints)
- Graceful shutdown handling (SIGTERM → complete current requests)
- Cooldown periods to avoid rapid thrashing
- Limits to prevent runaway provisioning costs

Scaling can mask defects. Profile and fix underlying issues (queries, memory leaks, hotspots) before increasing capacity.
If you must resize or replace a running instance (vertical scaling), plan for potential downtime and test the process in staging. Vertical changes often require service disruption.
Quick references
- Kubernetes Concepts — What is Kubernetes?
- Redis: https://redis.io/
- AWS S3: https://aws.amazon.com/s3/
- Autoscaling and load balancing patterns: https://aws.amazon.com/autoscaling/ and https://kubernetes.io/docs/concepts/services-networking/service/