CloudGuild · Blog · Cheat sheets · Lessons · Certifications
Cost Optimization for Fault-Tolerant Batch Jobs in AWS
Learn how to select the best EC2 purchasing option for cost-effective fault-tolerant batch jobs in AWS.
A common decision point for candidates involves selecting the most cost-effective EC2 purchasing option for specific workloads. In this case, a nightly batch job is fault tolerant, meaning it can be interrupted and restarted without major issues. This detail is critical in determining the best choice.
The question
A nightly batch job is fault tolerant and can be interrupted and restarted. Which EC2 purchasing option minimizes cost?
- A. On-Demand Instances
- B. Spot Instances
- C. Dedicated Hosts
- D. Reserved Instances
Think before you scroll
Consider the nature of the workload described. Since the job can be interrupted and restarted, it opens up the possibility of using less expensive options that might not guarantee availability.
The answer
The correct option is B. Spot Instances. Spot Instances provide significant cost savings, offering up to about 90% off compared to On-Demand pricing. They are ideal for workloads that can tolerate interruptions, such as the batch job described.
Why the other options lose
- A. On-Demand Instances: These are priced at a standard rate and are suitable for workloads that require consistent availability. They do not offer the cost efficiency needed for a fault-tolerant job that can be interrupted.
- C. Dedicated Hosts: This option is designed for customers who need to use specific server configurations and cannot share them with other customers. It's the most expensive choice and not suitable for cost-sensitive workloads like the one in the question.
- D. Reserved Instances: While they offer lower costs compared to On-Demand, they require a commitment for a period, typically one or three years. This is not ideal for a job that is intermittent and can be interrupted.
The concept behind it
The key principle here is understanding how to match workload characteristics with the appropriate EC2 purchasing options. Spot Instances excel for workloads that are fault-tolerant and can be paused or restarted. Knowing when to apply this strategy is vital for cost optimization in AWS.
Exam trap to remember
Remember: If a workload can be interrupted and restarted, Spot Instances are usually the best choice for cost savings.