Autoscaling Web Apps: Match Capacity to Demand
How horizontal and vertical autoscaling work, which signals to scale on and how to avoid scaling that is too slow or too jumpy.

Set up autoscaling that follows real demand: choose horizontal or vertical scaling, pick the right metrics, set limits and test how fast capacity reacts.
Traffic to business applications is rarely flat. Month-end reporting, marketing campaigns, working hours across time zones and seasonal peaks all change how much capacity an application needs. Running enough servers for the busiest moment all the time wastes money; running too few causes slow pages and errors when demand rises. Autoscaling addresses this by adding or removing capacity automatically based on signals such as CPU use, request rates or queue length. It works well when it is set up thoughtfully and tested, and badly when it is switched on with default settings and forgotten. This guide explains how autoscaling works, which signals to scale on, how to set limits and how to test that capacity really follows demand.
What autoscaling does
Autoscaling adjusts the resources available to an application in response to load. Kubernetes documentation describes its Horizontal Pod Autoscaler as automatically updating a workload resource with the aim of scaling capacity to match demand (Kubernetes: Horizontal Pod Autoscaling). Cloud providers offer similar features for virtual machine groups, containers, managed databases and serverless functions.
The main benefits are:
- Better performance during peaks, because capacity grows with demand
- Lower costs during quiet periods, because unused capacity is removed
- Less manual intervention when traffic changes
Horizontal and vertical scaling
The same Kubernetes documentation distinguishes two approaches. Horizontal scaling responds to increased load by deploying more Pods, or more instances in general terms. Vertical scaling, by contrast, means assigning more resources, such as memory or CPU, to the instances that are already running.
In practice:
- Horizontal scaling suits stateless web and API servers, where any instance can handle any request
- Vertical scaling suits workloads that cannot easily be split, though it often has upper limits and may require restarts
- Many setups use horizontal scaling for application tiers and plan database capacity separately
Make the application ready to scale
Autoscaling only helps if the application can run as several identical instances. Check that:
- Session data is stored outside individual instances, such as in a shared cache or database
- Uploaded files go to shared storage, not local disks
- Scheduled jobs do not run on every instance at once
- Instances start quickly and report readiness accurately
- Shutdown is graceful, so in-flight requests finish before an instance is removed
Our guide to Kubernetes zero downtime deployment covers readiness and graceful shutdown, which matter as much for scaling as for releases.
Choose the right scaling signals
The signal you scale on should reflect what actually limits the application:
- CPU use: simple and common, suitable for compute-heavy services
- Memory use: useful for some workloads, though memory often does not fall quickly after load drops
- Request rate or concurrent requests: closer to user demand for web services
- Queue length or age: suitable for background workers processing jobs
- Response time: reflects user experience, but can be affected by slow dependencies that more instances will not fix
If a database is the bottleneck, adding application instances may make things worse by sending more queries to an already busy database.
Set sensible limits
Always configure minimum and maximum capacity:
- Minimum: enough to handle normal load and survive the loss of one instance or zone
- Maximum: a ceiling that protects your budget and downstream systems, such as databases and third-party APIs
Check that cloud service quotas allow the maximum you set; otherwise scaling will stop early.
Tune how quickly scaling reacts
Scaling too slowly leaves users waiting during sudden peaks. Scaling too quickly, or too eagerly, causes capacity to swing up and down, which wastes money and can disrupt the application. Adjust:
- Thresholds that trigger scaling
- Cooldown or stabilisation periods between changes
- How many instances can be added or removed at once
Scale up promptly and scale down more cautiously, so brief dips do not remove capacity that is needed again moments later.
Plan for predictable peaks
When you know a peak is coming, such as a campaign launch or month-end processing, schedule extra capacity in advance rather than relying entirely on reactive scaling. New instances take time to start, and reactive scaling may lag behind a sudden surge.
Worked example: autoscaling settings by tier
The table below is a hypothetical set of autoscaling settings for a business web application. The values are illustrative and would need testing against real traffic.
TierScaling signalMinimumMaximumScale-up ruleScale-down ruleWeb front endRequests per instance210Add instances when target exceeded for a short periodRemove one at a time after a longer quiet periodAPI serversCPU use212Add instances when CPU stays above targetRemove gradually after stabilisationBackground workersQueue length18Add workers as queue growsRemove when queue is near empty for a whileDatabaseNot autoscaledSized for peakNot applicableManual review monthlyManual review monthly
Consider serverless and managed options
For some workloads, serverless functions or managed container services handle much of the scaling for you. They can suit spiky or unpredictable traffic, but come with their own limits, such as concurrency quotas, start-up delays and execution time caps. Compare these trade-offs with running and scaling your own instances, and check how each option bills for idle and peak usage.
Protect downstream systems
Scaling the application can push more load onto databases, caches and external APIs. Use connection pooling, rate limits and queues to protect them. Set maximum application capacity with these limits in mind, not only your budget.
Test scaling under load
Do not assume autoscaling works until you have seen it. Run load tests that ramp traffic up and down, and watch:
- How long it takes for new capacity to become ready
- Whether response times stay acceptable during scale-up
- Whether scale-down removes instances without dropping requests
- Whether databases and dependencies cope with the extra load
Our guide to API load testing covers designing tests that reveal how systems behave as demand grows.
Watch costs and behaviour over time
Review scaling activity and costs regularly. Look for constant scaling up and down, instances that never scale down, or maximums that are reached often. Adjust settings as traffic patterns change.
Combine autoscaling with good monitoring
Autoscaling reacts to signals; people still need to understand what happened. Monitor scaling events, capacity, response times and errors together, and alert when maximum capacity is reached or scaling fails.
Frequently Asked Questions
What is autoscaling?
It is the automatic adjustment of an application's capacity, such as the number of instances, based on signals like CPU use, request rates or queue length.
What is the difference between horizontal and vertical scaling?
Horizontal scaling adds more instances to handle load; vertical scaling gives existing instances more resources such as CPU or memory.
Which metric should autoscaling use?
The one that reflects what limits the application, such as requests per instance for web servers or queue length for background workers.
Why set a maximum for autoscaling?
To protect your budget, respect cloud quotas and avoid overwhelming databases and external services as the application grows.
Match capacity to real demand
We prepare applications for scaling, tune autoscaling settings and test them under realistic load. See our custom app development services, or talk to us about autoscaling.
About the Author
Manav Sharma is the founder of Insyrge and a CRM solutions architect. He works across Zoho, Salesforce, HubSpot, Odoo and more, designing the CRM setups, integrations and automations that keep sales and operations teams working from the same data.
Need Help Implementing This in Your Business?
Our certified Zoho consultants and automation experts can help you design and deploy custom workflows tailored to your operations.
Book Free Consultation