You must have heard about different scalability techniques that help your application or service handle more requests and return responses in minimum time. One such scalability technique is called vertical scaling. Let’s understand vertical scaling based on an example
- Application Deployment Configuration
- RAM and CPU usage on Normal Load
- RAM and CPU usage on High Load
- How to Fix Server Crash Issue
- Advantages of Vertical Scaling
- Disadvantages of Vertical Scaling
- Learn More
Application Deployment Configuration
Let’s say you have designed a library management system in Python and then deployed the same on an AWS EC2 instance. The configuration of the AWS EC2 instance is
- CPU = 2 Core
- RAM = 1 GB
The library management application is deployed in production and users are using it. As the number of users are increasing the load on the system is also increasing. New threads are getting created to handle more people and because of that CPU usage and RAM usage is also increasing.
RAM and CPU usage on Normal Load
When the number of users is less then let’s say that the maximum CPU usage is 30 percent and the maximum RAM usage is 400MB.
These values are within the limit and there is no need to scale your system
- For CPU Usage
- X-Axis: Time interval
- Y-Axis: Percentage of CPU used
- For RAM Usage
- X-Axis: Time interval
- Y-Axis: Megabyte of RAM Used
RAM and CPU usage on High Load
When the number of users increases then the CPU and RAM usage also reaches its maximum. At this point, the server can crash because all the resources have been exhausted.
In the graph you can see that both CPU and RAM usage has reached to its maximum value and the machine can crash anytime.
How to Fix Server Crash Issue
In such case you can increase the resources of your AWS EC2 instance and the CPU and the RAM usage will come back to normal. The new configuration can be
- CPU = 6 Core
- RAM = 10 GB
Improving the application by increasing the CPU and RAM configuration is called as Vertical Scaling
Advantages of Vertical Scaling
- No extra services are added to increase the scalability
- Easy to increase the resources of your machine
Disadvantages of Vertical Scaling
- It has a limit because you can’t increase the CPU and RAM of an application infinitely
- It is more costly because of the high CPU and RAM for a single machine
- Single Point of Failure
- If you depend on one machine and only increase the resources of this machine then your whole application will fail if the current machine fails