Scaling a Web Application: Vertical vs Horizontal
Growth is good news until the website slows down at peak hours. There are two basic ways to add capacity, and most applications eventually use both.
Vertical scaling: a bigger server
- Add CPU, memory or faster storage to the existing server.
- No application changes needed — often a quick resize on a VPS.
- Limited by the largest available machine, and the server remains a single point of failure.
Horizontal scaling: more servers
- Run several application servers behind a load balancer.
- Capacity grows by adding servers; one failing does not take the site down.
- Requires the application to be stateless — sessions, uploads and caches must live in shared services.
Find the real bottleneck first
- Measure CPU, memory, disk I/O and database query times under load.
- Often the database is the bottleneck — fix slow queries and add indexes before adding servers.
- Add caching for pages, objects and static files; a CDN for assets.
A typical path
Start vertical, optimise the database and caching, then split into separate web and database servers, and finally add load-balanced web servers.
We size and scale servers through our VPS service. Get a performance review.
