Applying load on Auto Scaling Group Nodes

Introduction :-

Dynamic #scaling policies for an #Autoscaling Group (ASG) play a crucial role in ensuring the efficient and automated management of resources in a #cloud-based environment. ASGs are a fundamental component of scalable and resilient applications, allowing them to automatically adjust the number of instances (nodes) based on fluctuating demand. By creating intelligent scaling policies, organizations can optimize resource utilization, minimize costs, and ensure a smooth user #experience during peak and off-peak periods.

Pre-Requestisites :-

  • An AWS account with appropriate permissions to create resources like #cloudwatch alarms, Autoscaling group.

  • Basic knowledge of #Ec2 and AWS.

Step 1 :- Create a Autoscaling group using launch template.

Step 2 :- Once the auto scaling group is created start creating dynamic policies and life cycle hooks in asg as shown below.

Step 3 :- Now connect with your asg instance’s using #ssh and increase the cpu load on your instance’s by installing stress as shown in the below image.

#install stress
sudo amazon-linux-extras install epel -y
sudo yum install stress -y

#After installing, increase the stress using below command.
stress --cpu 2 --timeout 300

Step 6 :- Once the load is applied check whether the alarm’s are triggering or not. If the alarm triggers, you can see that the nodes are #scaling up.

once the stress is increased you can see that the alarm’s are getting triggered in the above figure.

Conclusion :-

This document demonstrated the process of applying CPU load on the #AutoScalingGroup (ASG) nodes and testing the alarms set up in the AWS environment. By simulating CPU load on the instances within the ASG, we were able to trigger the #CloudWatch alarms based on the defined thresholds. These alarms effectively monitored the CPU utilization of the instances and took #actions, such as triggering Auto Scaling policies or sending notifications through #SNS topics, based on the alarm states.

0
Subscribe to my newsletter

Read articles from Mahira Technology Private Limited directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Mahira Technology Private Limited
Mahira Technology Private Limited

A leading tech consulting firm specializing in innovative solutions. Experts in cloud, DevOps, automation, data analytics & more. Trusted technology partner.