EC2 - Spot Instance and Spot Fleet Flashcards
What is the primary benefit of using EC2 Spot Instances?
EC2 Spot Instances allow you to save up to 90% compared to On-Demand instances by bidding for unused EC2 capacity.
How does the Spot Instance pricing mechanism work?
You define a maximum price you’re willing to pay. As long as the current Spot price is below your max price, the instance continues running. If the price exceeds your max price, the instance is terminated or stopped (with a 2-minute warning).
What happens if the Spot price goes above the max price you set?
AWS gives you a 2-minute grace period to either:
Stop the instance and resume later when the price drops.
Terminate the instance if you don’t need to preserve its state.
What is a Spot Block?
A Spot Block allows you to reserve Spot Instances for a fixed period (1 to 6 hours) without interruption, providing a more stable experience, though interruptions are still possible in rare cases.
When should you use Spot Instances in AWS?
Spot Instances are ideal for batch jobs, data analysis, or workloads that are resilient to interruptions. They are not suitable for critical applications like databases.
How do Spot Instance prices fluctuate?
Spot prices vary across Availability Zones (AZs) and can fluctuate over time. For example, a M4.large instance’s Spot price might vary between $0.35 to $0.45 per hour. You can set a maximum price to control your costs.
What are the two types of Spot Instance Requests?
If your instance is interrupted, the request automatically re-launches the instance when capacity becomes available.
What is the correct procedure to terminate a Spot Instance?
Cancel the Spot Request (to prevent further instances from launching).
Terminate the Spot Instances (this ends the running instances).
What is a Spot Fleet in AWS?
A Spot Fleet allows you to define a set of Spot Instances (and optionally On-Demand instances) to meet a target capacity while optimizing costs. It can automatically manage different instance types, operating systems, and Availability Zones.
What are the different Spot Fleet allocation strategies?
There are four main strategies for Spot Fleets:
Lowest Price: Chooses the least expensive Spot pool.
Diversified: Distributes Spot Instances across different pools for improved availability.
Capacity Optimized: Prioritizes pools with the best capacity to meet your demand.
Price Capacity Optimized: Chooses the lowest price from the most optimal capacity pool.
How does a Spot Fleet optimize costs?
Spot Fleets choose the best combination of Spot pools based on your defined strategy (e.g., Lowest Price), ensuring cost savings while meeting your target capacity.
How much can you save using Spot Instances?
For example, an On-Demand price for an EC2 instance might be $0.10/hour, while a Spot Instance might cost only $0.04/hour, resulting in 60% savings.
How do Spot Instance prices change over time?
Spot prices vary based on supply and demand for EC2 capacity in a region, and they fluctuate hourly. For example, an m4.large instance might fluctuate between $0.35 and $0.45 over time.
When should you avoid using Spot Instances?
Spot Instances are not recommended for critical workloads, such as databases, that require high availability and consistent performance.