반응형
SQS - CloudWatch - Auto Scaling 조합
AWS에서 SQS와 CloudWatch, Auto Scaling를 연동시키는 방법이 자주 나온다.
애플리케이션에 Auto Scaling을 실현하기 위해서
위와 같이 SQS와 CloudWatch, Auto Scaling을 연동하여 인스턴스를 자동으로 스케일링할 수 있는 아키텍쳐를 자주 사용한다.
[애플리케이션 → SQS → CloudWatch]
애플리케이션에서 요청을 SQS Queue로 처리한다. 요청은 CloudWatch에 기록된다.
[SQS → CloudWatch Alarm]
요청이 급격히 증가한 경우, SQS 큐에 대기 중인 메시지 수가 특정 값을 초과하면 CloudWatch Alarm가 경고를 보낸다.
[CloudWatch Alarm → Auto Scaling]
CloudWatch Alarm은 Auto Scaling에 경고를 보내고 인스턴스 수를 늘린다 (스케일 아웃).
큐에 메시지가 없어지면 인스턴스 수를 줄여서(스케일 인) 비용을 절감하는 운영이 가능하다.
728x90
반응형