Back-End/AWS

[AWS] Amazon Linux 2 Stress를 이용한 Auto Scaling 테스트 방법

양짱 2021. 7. 25. 17:51

CPU 로드 증가시 Auto Scaling 테스트를 위해서 EC2 instance 에 CPU 부하 테스트 및 확인 방법입니다.

 

1. stress utility on Amazon Linux 2 패키지 설치

https://gist.github.com/mikepfeiffer/d27f5c478bef92e8aff4241154b77e54

 

Install Stress Utility on Amazon Linux 2

Install Stress Utility on Amazon Linux 2. GitHub Gist: instantly share code, notes, and snippets.

gist.github.com

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

 

2. stress 테스트 수행

stress -c 4

 

 

3. CloudWatch에서 CPU 사용량 경고 확인

4. Auto Scaling 그룹 활동 확인시 ALARM으로 인해서 EC2 instance가 새로 생성 확인이 가능합니다.