1. EC2 Spot Instance Request
▶ Can get a discount up to 90% compared to On-demand
▶ Define max spot price and get the instance while current spot price < max
- 인스턴스의 스팟 가격이 우리가 지불하고자 하는 최대 가격보다 낮다면 해당 인스턴스 유지
▶ The hourly spot price varies based on offer and capacity.
- 시간당 스팟은 오퍼나 용량에 따라 다르다.
⭐ If the current spot price > your max price you can choose to stop or terminate your instance with a 2 minutes grace period.
▶ 현재 스팟 가격이 정의된 최대 가격을 초과하면, 두 가지를 선택 할 수 있다. (2분의 유예기간 제공됨)
▶ Option1_ 인스턴스 중지: 하던 작업 중지하고 어느 날 스팟 가격이 최대 가격 아래로 내려가면 중단했던 곳부터 인스턴스 다시 시작
▶ Option2_ 더 이상 필요하지 않다면 그냥 인스턴스 종료하고 작업 다시 시작할 때 새로운 인스턴스로 시작
▶ Other strategy: Spot Block
- AWS 가 스팟 인스턴스를 회수하는 것을 원하지 않는다면 스팟 블럭 사용
- 스팟 블럭은 지정된 기간 동안 스팟 인스턴스 차단하는 것
- "block" spot instance during a specified time frame(1 to 6 hours) without interruptions
- In rare situations, the instance may be reclaimed
🔥 Spot Blocks are no longer available to new AWS customers since July 1st 2021 And won't be supported after
December 31 2022 but Still, they might appear in the exam
- 2022년 이후로 서비스가 종료되었으나 시험에 나올 수 있으므로 알아두자
▶ EC2 Spot Instance is Used for batch jobs, data analysis, or workloads that are resilient to failures.
▶ Spot prices are based on AZ (region, ect)

⭐ If your user-defined max-price be something like $0.06 per hour, then no spot instance will be reclaimed.
2. How to terminate Spot Instances?


2-1. Spot Instance Request (스팟 인스턴스 요청)
Spot Instance를 요청하는 과정에서, 사용자는 Spot Request를 생성한다.
▶ Spot Request 상태
Open: 요청이 아직 안 된 상태, 인스턴스를 실행할 수 있는 자원이 준비되지 않음.
Active: 요청이 충족되어 Spot Instance가 실행 중인 상태
Disabled: 사용자가 요청을 비활성화하거나 특정 조건에 따라 비활성화된 상태
⭐ Spot Instance Request는 Open, Active, Disabled 상태일 때만 취소할 수 있다.
- 취소 할 수 없는 경우: Failed, Cancelled, Closed
⭐ Spot Request를 취소해도 Spot Instance는 중지되지 않는다. 별도로 인스턴스를 중지하거나 종료해야 한다.
⭐ Spot Instance를 중지하려면 먼저 Spot Request를 취소해야 한다.
- 취소하는 것은 이전에 시작한 인스턴스를 종료하는 것이 아니다.
- 인스턴스를 종료하는 것은 유저가 할 일이지 AWS 가 하는 일이 아니다.
🔥 따라서 스팟 인스턴스를 완전히 종료하고 다시 시작되지 않도록 하려면, 먼저 스팟 요청을 취소한 다음, 해당 스팟 인스턴스를 종료해야 한다.
왜냐하면 스팟 인스턴스를 먼저 종료하면 AWS는 활성화된 스팟 요청(Active Spot Request)을 기준으로 다시 자원을 할당해 인스턴스를 재생성하려고 시도하기 때문이다. 스팟 요청은 사용자가 명시적으로 취소하지 않는 한 계속 남아있기 때문에, 요청 상태를 먼저 처리하지 않으면 인스턴스가 자동으로 다시 실행될 가능성이 있다.
👉 순서가 중요한 이유
스팟 요청을 취소하면, AWS는 해당 요청과 관련된 재할당 작업을 중한다.
그런 다음, 실행 중인 스팟 인스턴스를 종료하면 더 이상 인스턴스가 다시 생성되지 않는다.
이렇게 해야 스팟 인스턴스와 요청 모두 완전히 종료되고, 비용 발생도 중단된다.
3. Spot Fleets
▶ Spot Feets = set of Spot Instances + (optional) On-Demand Isntances
▶ The Spot Fleet will try to meet the target capacity with price constraints.
- Define possible launch pools: instance type (m5.large), OS, Availability Zone
- Can have multiple launch pools, so that the fleet can choose
- Spot Fleets stops launching instances when reaching capacity or max cost
▶ Strategies to allocate Spot Instances:
- lowestPrice: from the pool with the lowest price (cost optimization, short workload)
- diversified: distributed across all pools (great for availability, long workloads)
특정 유형의 Spot Instance(예: t3.large)를 요청하면, 해당 인스턴스 유형은 여러 Spot Capacity Pool에서 제공된다.Diversified 전략은 한 풀이 소진되거나 중단될 경우 다른 풀에서 인스턴스를 유지하도록 설계되어, 가용성이 높다.
- capacityOptimized: pool with the optimal capacity for the number of instance
- priceCapacityOptimized (recommeded): pools with highest capacity available, then select the pool with the lowest price (best choice for most workloads)
가격 용량 최적화는 먼저 사용 가능한 용량이 가장 큰 풀을 선택하고 그 중 가격이 가장 낮은 풀을 선택하는 전략
⭐ Spot fleets allow us to automatically request Spot Instances with the lowest price
4. Spot Instances VS Spot Fleets 정리
4-1. Spot Instances
▶ AWS의 EC2 인스턴스 유형 중 하나로, 미사용 EC2 용량을 경매 방식으로 제공한다.
▶ 일반 온디맨드 인스턴스보다 최대 90% 저렴하지만, AWS가 필요하면 언제든지 인스턴스를 종료할 수 있다.
▶ 특정한 단일 인스턴스를 요청해 사용하는 방식이다.
▶ 단일 인스턴스 요청.
▶ 특정 워크로드에 활용 (예: 배치 처리, 데이터 분석, CI/CD 작업)
▶ 가격은 변동 가능 (AWS Spot 시장 상황에 따라)
▶ 갑작스러운 중단에 대비해야 함. (Spot Instance 중단 통보는 2분 전에 제공)
4-2. Spot Fleets
▶ Spot Instances의 집합을 관리하는 서비스로, 여러 가용 영역, 인스턴스 유형, 구매 옵션을 조합해 최적의 비용 효율성을 제공한다.
▶ Spot Fleet 요청을 생성하면 AWS가 사용자가 설정한 정책(예: 비용 최적화, 가용성)을 기준으로 여러 Spot Instances를 할당 및 관리한다.
▶ 다양한 인스턴스와 영역 조합: 온디맨드, 예약 인스턴스, Spot Instances를 혼합 가능하다.
▶ 자동 스케일링: 요청에 따라 자동으로 인스턴스를 추가하거나 제거한다.
▶ Fleet에서 종료된 Spot Instance가 있으면 새 인스턴스로 대체 가능하다.
▶ 비용 관리 정책(최저 비용, 최대 처리량 등) 설정 가능하다.
Spot Instances → 배치 작업, 개발 테스트 환경, 일회성 워크로드
Spot Fleets → 분산 처리, 대규모 데이터 분석, 머신러닝 모델 학습, 웹 애플리케이션 스케일링
특징 | Spot Instances | Spot Fleet |
관리 단위 | 단일 Spot Instance 요청 | 여러 인스턴스 요청 관리 (Fleet 단위) |
구성 가능성 | 단일 가용역역, 개별적으로 사용하는 경우 | 다양한 가용 영역, 인스턴스 유형 + 구매옵션 조합 |
자동화 수준 | 사용자가 수동으로 관리 | Fleet이 자동으로 인스턴스 추가 & 대체 |
활용 범위 | 단일 작업, 작은 workloads | 대규모 작업, 비용 최적화가 중요한 환경 |
'AWS' 카테고리의 다른 글
[AWS] Solutions Architect Associate 실습 14일차 - EC2 Basic Test 문제 / 정리 (7) | 2025.02.01 |
---|---|
[AWS] Solutions Architect Associate 실습 13일차 - EC2 Instance launch type (83) | 2025.01.29 |
[AWS] Solutions Architect Associate 실습 11일차 - EC2 Instance Purchasing (27) | 2025.01.26 |
[AWS] Solutions Architect Associate 실습 10일차 - EC2 Instance connect (14) | 2025.01.26 |
[AWS] Solutions Architect Associate 실습 9일차 - SSH (9) | 2025.01.25 |
1. EC2 Spot Instance Request
▶ Can get a discount up to 90% compared to On-demand
▶ Define max spot price and get the instance while current spot price < max
- 인스턴스의 스팟 가격이 우리가 지불하고자 하는 최대 가격보다 낮다면 해당 인스턴스 유지
▶ The hourly spot price varies based on offer and capacity.
- 시간당 스팟은 오퍼나 용량에 따라 다르다.
⭐ If the current spot price > your max price you can choose to stop or terminate your instance with a 2 minutes grace period.
▶ 현재 스팟 가격이 정의된 최대 가격을 초과하면, 두 가지를 선택 할 수 있다. (2분의 유예기간 제공됨)
▶ Option1_ 인스턴스 중지: 하던 작업 중지하고 어느 날 스팟 가격이 최대 가격 아래로 내려가면 중단했던 곳부터 인스턴스 다시 시작
▶ Option2_ 더 이상 필요하지 않다면 그냥 인스턴스 종료하고 작업 다시 시작할 때 새로운 인스턴스로 시작
▶ Other strategy: Spot Block
- AWS 가 스팟 인스턴스를 회수하는 것을 원하지 않는다면 스팟 블럭 사용
- 스팟 블럭은 지정된 기간 동안 스팟 인스턴스 차단하는 것
- "block" spot instance during a specified time frame(1 to 6 hours) without interruptions
- In rare situations, the instance may be reclaimed
🔥 Spot Blocks are no longer available to new AWS customers since July 1st 2021 And won't be supported after
December 31 2022 but Still, they might appear in the exam
- 2022년 이후로 서비스가 종료되었으나 시험에 나올 수 있으므로 알아두자
▶ EC2 Spot Instance is Used for batch jobs, data analysis, or workloads that are resilient to failures.
▶ Spot prices are based on AZ (region, ect)

⭐ If your user-defined max-price be something like $0.06 per hour, then no spot instance will be reclaimed.
2. How to terminate Spot Instances?


2-1. Spot Instance Request (스팟 인스턴스 요청)
Spot Instance를 요청하는 과정에서, 사용자는 Spot Request를 생성한다.
▶ Spot Request 상태
Open: 요청이 아직 안 된 상태, 인스턴스를 실행할 수 있는 자원이 준비되지 않음.
Active: 요청이 충족되어 Spot Instance가 실행 중인 상태
Disabled: 사용자가 요청을 비활성화하거나 특정 조건에 따라 비활성화된 상태
⭐ Spot Instance Request는 Open, Active, Disabled 상태일 때만 취소할 수 있다.
- 취소 할 수 없는 경우: Failed, Cancelled, Closed
⭐ Spot Request를 취소해도 Spot Instance는 중지되지 않는다. 별도로 인스턴스를 중지하거나 종료해야 한다.
⭐ Spot Instance를 중지하려면 먼저 Spot Request를 취소해야 한다.
- 취소하는 것은 이전에 시작한 인스턴스를 종료하는 것이 아니다.
- 인스턴스를 종료하는 것은 유저가 할 일이지 AWS 가 하는 일이 아니다.
🔥 따라서 스팟 인스턴스를 완전히 종료하고 다시 시작되지 않도록 하려면, 먼저 스팟 요청을 취소한 다음, 해당 스팟 인스턴스를 종료해야 한다.
왜냐하면 스팟 인스턴스를 먼저 종료하면 AWS는 활성화된 스팟 요청(Active Spot Request)을 기준으로 다시 자원을 할당해 인스턴스를 재생성하려고 시도하기 때문이다. 스팟 요청은 사용자가 명시적으로 취소하지 않는 한 계속 남아있기 때문에, 요청 상태를 먼저 처리하지 않으면 인스턴스가 자동으로 다시 실행될 가능성이 있다.
👉 순서가 중요한 이유
스팟 요청을 취소하면, AWS는 해당 요청과 관련된 재할당 작업을 중한다.
그런 다음, 실행 중인 스팟 인스턴스를 종료하면 더 이상 인스턴스가 다시 생성되지 않는다.
이렇게 해야 스팟 인스턴스와 요청 모두 완전히 종료되고, 비용 발생도 중단된다.
3. Spot Fleets
▶ Spot Feets = set of Spot Instances + (optional) On-Demand Isntances
▶ The Spot Fleet will try to meet the target capacity with price constraints.
- Define possible launch pools: instance type (m5.large), OS, Availability Zone
- Can have multiple launch pools, so that the fleet can choose
- Spot Fleets stops launching instances when reaching capacity or max cost
▶ Strategies to allocate Spot Instances:
- lowestPrice: from the pool with the lowest price (cost optimization, short workload)
- diversified: distributed across all pools (great for availability, long workloads)
특정 유형의 Spot Instance(예: t3.large)를 요청하면, 해당 인스턴스 유형은 여러 Spot Capacity Pool에서 제공된다.Diversified 전략은 한 풀이 소진되거나 중단될 경우 다른 풀에서 인스턴스를 유지하도록 설계되어, 가용성이 높다.
- capacityOptimized: pool with the optimal capacity for the number of instance
- priceCapacityOptimized (recommeded): pools with highest capacity available, then select the pool with the lowest price (best choice for most workloads)
가격 용량 최적화는 먼저 사용 가능한 용량이 가장 큰 풀을 선택하고 그 중 가격이 가장 낮은 풀을 선택하는 전략
⭐ Spot fleets allow us to automatically request Spot Instances with the lowest price
4. Spot Instances VS Spot Fleets 정리
4-1. Spot Instances
▶ AWS의 EC2 인스턴스 유형 중 하나로, 미사용 EC2 용량을 경매 방식으로 제공한다.
▶ 일반 온디맨드 인스턴스보다 최대 90% 저렴하지만, AWS가 필요하면 언제든지 인스턴스를 종료할 수 있다.
▶ 특정한 단일 인스턴스를 요청해 사용하는 방식이다.
▶ 단일 인스턴스 요청.
▶ 특정 워크로드에 활용 (예: 배치 처리, 데이터 분석, CI/CD 작업)
▶ 가격은 변동 가능 (AWS Spot 시장 상황에 따라)
▶ 갑작스러운 중단에 대비해야 함. (Spot Instance 중단 통보는 2분 전에 제공)
4-2. Spot Fleets
▶ Spot Instances의 집합을 관리하는 서비스로, 여러 가용 영역, 인스턴스 유형, 구매 옵션을 조합해 최적의 비용 효율성을 제공한다.
▶ Spot Fleet 요청을 생성하면 AWS가 사용자가 설정한 정책(예: 비용 최적화, 가용성)을 기준으로 여러 Spot Instances를 할당 및 관리한다.
▶ 다양한 인스턴스와 영역 조합: 온디맨드, 예약 인스턴스, Spot Instances를 혼합 가능하다.
▶ 자동 스케일링: 요청에 따라 자동으로 인스턴스를 추가하거나 제거한다.
▶ Fleet에서 종료된 Spot Instance가 있으면 새 인스턴스로 대체 가능하다.
▶ 비용 관리 정책(최저 비용, 최대 처리량 등) 설정 가능하다.
Spot Instances → 배치 작업, 개발 테스트 환경, 일회성 워크로드
Spot Fleets → 분산 처리, 대규모 데이터 분석, 머신러닝 모델 학습, 웹 애플리케이션 스케일링
특징 | Spot Instances | Spot Fleet |
관리 단위 | 단일 Spot Instance 요청 | 여러 인스턴스 요청 관리 (Fleet 단위) |
구성 가능성 | 단일 가용역역, 개별적으로 사용하는 경우 | 다양한 가용 영역, 인스턴스 유형 + 구매옵션 조합 |
자동화 수준 | 사용자가 수동으로 관리 | Fleet이 자동으로 인스턴스 추가 & 대체 |
활용 범위 | 단일 작업, 작은 workloads | 대규모 작업, 비용 최적화가 중요한 환경 |
'AWS' 카테고리의 다른 글
[AWS] Solutions Architect Associate 실습 14일차 - EC2 Basic Test 문제 / 정리 (7) | 2025.02.01 |
---|---|
[AWS] Solutions Architect Associate 실습 13일차 - EC2 Instance launch type (83) | 2025.01.29 |
[AWS] Solutions Architect Associate 실습 11일차 - EC2 Instance Purchasing (27) | 2025.01.26 |
[AWS] Solutions Architect Associate 실습 10일차 - EC2 Instance connect (14) | 2025.01.26 |
[AWS] Solutions Architect Associate 실습 9일차 - SSH (9) | 2025.01.25 |