스팟 인스턴스 최적화 가이드
Spot Instances Optimization Guide
Spot Instances (AWS), Spot VMs (Azure), and Spot/Preemptible VMs (GCP) are spare 클라우드 capacity offered at 70 to 90 percent off the on-demand 가격. The catch is that the 클라우드 프로바이더 can reclaim the 인스턴스 with as little as 30 seconds of warning when demand for the underlying hardware rises. For 워크로드s that can tolerate interruption — and only for those 워크로드s — 스팟 is the cheapest 컴퓨트 in the public 클라우드 by a wide margin.
What Workloads Belong on Spot
Spot is appropriate for 워크로드s that are stateless, fault-tolerant, and interruptible:
- Batch and HPC jobs — image rendering, video transcoding, Monte Carlo simulations. Checkpoint progress and resume on a replacement 인스턴스.
- CI/CD runners — job queues can wait for a replacement 인스턴스 without missing release deadlines.
- Stateless web tiers — behind a load balancer with autoscaling, an evicted 인스턴스 is replaced in seconds.
- Big-data processing — Spark, Hadoop, and data-warehouse clusters designed to handle node loss.
- Dev and test environments — non-production 워크로드s where a 2-minute interruption is acceptable.
Spot is not appropriate for stateful databases, single-인스턴스 applications with no replica, interactive sessions with users, or batch jobs that cannot be checkpointed.
Provider Comparison
| Provider | Min eviction notice | Max lifetime | Typical discount |
|---|---|---|---|
| AWS Spot Instances | 2 minutes | none | ~70% off on-demand |
| Azure Spot VMs | 30 seconds | none | ~80% off (Linux) |
| GCP Spot VMs | 30 seconds | none | ~60-91% off |
| GCP Preemptible VMs (legacy) | 30 seconds | 24 hours max | ~60-80% off |
GCP Spot VMs (the successor to Preemptible VMs) give the deepest 할인, and GCP sends a shutdown script 30 seconds before eviction. AWS Spot offers the gentlest notice (2 minutes), giving batch jobs time to checkpoint. Azure falls in between.
Designing for Interruption
The four patterns that make 스팟 reliable:
- Checkpoint and resume — write progress to durable 스토리지 (S3, Cloud Storage) every few minutes, and restart from the last checkpoint on a replacement 인스턴스.
- Distributed work queue — use a queue (SQS, Pub/Sub, Service Bus) to hand out work units. If an 인스턴스 is evicted, the work unit returns to the queue for another 인스턴스 to pick up.
- Multi-인스턴스 + autoscaler — run a minimum of 2 스팟 인스턴스s behind a load balancer and configure an autoscaler to launch a replacement when one is evicted.
- Spot + on-demand mix — run 70 to 90 percent of capacity on 스팟 and the remainder on on-demand or 예약, so the 워크로드 degrades gracefully rather than fully stopping when 스팟 is unavailable.
Spot Fleet and Capacity Rebalancing
AWS Spot Fleet and Azure Spot VM Scale Sets let you request a target capacity across multiple 인스턴스 types and Availability Zones, which dramatically reduces the chance of all your 스팟 capacity being reclaimed at once. Configure the fleet to span 3 to 5 인스턴스 types across 2 to 3 zones, and the probability of total loss drops below 1 percent per month.
GCP does not have a direct Spot Fleet equivalent, but MIG (Managed Instance Group) with multiple 인스턴스 templates and the proactiveRefresh setting achieves a similar effect.
Cost Tracking
Spot 가격s fluctuate with demand, so a 워크로드 that 비용s $0.029 per hour today might 비용 $0.058 per hour next week. Set billing alerts at 110 percent of the rolling 30-day average, and configure your fleet to fall back to on-demand automatically when the 스팟 가격 exceeds the on-demand 가격 — at that point 스팟 offers no savings and only adds interruption risk.
See our AWS vs Azure 컴퓨트 비교 for the per-인스턴스 스팟 할인, and the 예약 인스턴스s 가이드 for the commitment strategy to apply to the on-demand portion of your mixed fleet.