Auto scaling
- All the cloud support elasticity i.e. increasing as well as decreasing.
- Scaling is of two forms
- Vertical scaling:
- increasing or decreasing the size of servers
- scale up and down
- Horizontal Scaling
- increasing or decreasing the number of servers
- Scale in and Scale out
- Vertical scaling:
- To Scale the application running on a vm we should have an Image with application pre-installed.
- The next factor is define Scaling category
- Deterministic: We know the peak hours and scale accordingly
- Un Deterministic: We donot know the peak hours and have to rely on some metrics to scale.
- Fixed: Always the fixed number of servers
- Cloud Providers have started offering predictive scaling this is a ML model which learns your scaling needs
- High Availability: Ability of system to have minimal or zero downtime despite traffic peaks
- Fault Tolerance: Ability of System to continue being operational despite errors
-
Application types depending on customer geo locations
- users are global
- users are regional or local.
- Impact of this on Application deployments
- Multi-Regional
- Multi-Zonal
- Auto scaling is supported in
- AWS using Auto scaling groups (ASG)
- Azure using Virtual Machine Scale Sets (VMSS)
Steps To Acheive
- How to create Images in AWS and Azure
- How to configure Auto Scaling
Images
- AWS uses a term called as AMI (Amazon Machine Image)
- Azure uses a term called as VM Image
- Generalize image: User can set credentials
- Specialized Images: Users can’t set credentials
AMI
- To create an AMI, We need to create an ec2 instance, install necessary softwares and then create image
- Create Image takes snapshot of a root volume (disk) and creates an AMI with a unique id in the same region where ec2 is running
- If we need this image in other regions, we can copy the image to multiple regions.
- Note: image copied to other region will get a new AMI id.
Create an AMI (Manual)
- AMI 1: Lets create an AMI for troweld website with name foundry
- AMI 2: Lets create an AMI for carpernter website with name carpernter
- Note: We will be installing an extra software called as stress to create artifical stress
Foundry
- Lets create an ec2 instance with ubuntu 24.04
#!/bin/bash
sudo apt update
sudo apt install nginx unzip stress -y
cd /tmp
wget https://www.free-css.com/assets/files/free-css-templates/download/page294/troweld.zip
unzip troweld.zip
mv troweld-html/ foundry/
sudo mv foundry/ /var/www/html/
- Now lets create an AMI





-
Now lets launch an ec2 instance with the AMI created above

-
AMIs are of the following type by ownership
- Amazon offered official AMIs: These are images of popular OS offered by Amazon for customers, some of the Amazon offered images might include hourly costs
- MarketPlace Images: These are created by third party (Companies) with specific images which might include hourly costs

- Private Images: These are created by users for their internal purposes. This will have storage costs. These images can be shared with specific AWS accounts
- Community Images: These are created by users and shared to other users for free of cost.
Carpenter
- Now lets create an AMI by following the steps as done in previous case (refer classroom recording if necessary)
#!/bin/bash
sudo apt update
sudo apt install nginx unzip stress -y
cd /tmp
wget https://www.free-css.com/assets/files/free-css-templates/download/page294/woody.zip
unzip woody.zip
mv carpenter-website-template/ carpenter/
sudo mv carpenter/ /var/www/html/
Auto Scaling
- For Creating an Autoscaling group, we need to create a Launch Template where we specify the redundant selection paramters such as AMI, security group, instance type etc
- Also while creating asg we need to select more than one AZ

Creating a Launch Template
- Watch clasroom recording.

Fixed Scaling with ASG
- For selection options watch classroom recording




