Files
nexus/wiki/concepts/EC2-Spot-Instances.md
2026-04-20 00:02:56 +08:00

46 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "EC2 Spot Instances"
type: concept
tags:
- AWS
- EC2
- Cost-Optimization
- Spot
sources: []
last_updated: 2026-04-19
---
## Definition
EC2 Spot Instances 是 AWS 提供的一种利用闲置计算容量的实例类型,相比按需定价最高可节省 90% 成本。
## Key Characteristics
- 利用 AWS 数据中心的闲置容量
- 相比按需实例最高可享 90% 折扣
- 当 AWS 需要回收容量时可能会被中断
- 提供中断前通知机制
- 支持与 Auto Scaling、EKS、ECS 集成
## Use Cases
- Web 服务(具备容错能力)
- 容器化工作负载
- 高性能计算批处理
- 大数据分析
- CI/CD 流水线
## Key Considerations
- **容错能力**:应用需能处理实例中断
- **灵活性**:支持跨多个实例类型和可用区
- **无状态**:适合无状态工作负载
- **中断风险**AWS 提前 2 分钟通知回收
## Best Practices
- 跨实例类型和可用区分散部署
- 配置自动响应中断的机制
- 结合 Graviton 使用进一步优化成本
## Connections
- [[AWS]] ← provides ← [[EC2-Spot-Instances]]
- [[Cost-Optimization]] ← achieved_by ← [[EC2-Spot-Instances]]
- [[Spot-Interruption]] ← risk_of ← [[EC2-Spot-Instances]]
- [[EKS]] ← supports ← [[EC2-Spot-Instances]]
- [[ECS]] ← supports ← [[EC2-Spot-Instances]]