EC2 Instance Purchasing Options
EC2 Instance Purchasing Options
On-Demand Instances
- Allows running instances on demand.
- Suitable for short workloads.
- Predictable pricing, billed by the second (for Linux or Windows after the first minute) or by the hour (for other operating systems).
- Highest cost but no upfront payments or long-term commitments.
- Recommended for short-term, uninterrupted workloads where application behavior is unpredictable.
Reserved Instances
- Offers up to 72% discount compared to On-Demand instances.
- Requires reserving specific instance attributes (instance type, region, tenancy, OS).
- Specify a reservation period: one year or three years for more discounts.
- Payment options: upfront, partially upfront, or no upfront (all upfront provides maximum discounts).
- Scope: specific region or Availability Zone (AZ) for reserved capacity.
- Suitable for steady-state usage applications (e.g., databases).
- Can be bought or sold in the marketplace if no longer needed.
Convertible Reserved Instances
- Allows changing instance type, instance family, operating system, scope, and tenancy.
- Offers up to 66% discounts (less than standard Reserved Instances due to flexibility).
Savings Plans
- Offers similar discounts as Reserved Instances (up to 72%) based on long-term usage.
- Commit to a specific amount of usage in dollars per hour (e.g., $10 per hour for one to three years).
- Usage beyond the Savings Plan is billed at On-Demand prices.
- Locked to specific instance family and region (e.g., m5 in US East 1).
- Flexible across instance sizes (e.g., m5.xlarge, m5.2xlarge).
- Can switch between Linux and Windows OS.
- Can switch between host, dedicated, and default tenancy.
Spot Instances
- Offers the most aggressive discounts (up to 90% compared to On-Demand).
- Instances can be lost at any time if the spot price exceeds the defined maximum price.
- Most cost-efficient instances.
- Suitable for workloads resilient to failure:
- Batch jobs
- Data analysis
- Image processing
- Distributed workloads
- Workloads with flexible start and end times.
- Not suited for critical jobs or databases.
Dedicated Hosts
- Provides an entire physical server dedicated to your use.
- Use cases:
- Compliance requirements.
- Using existing server-bound software licenses billed per socket, per core, or per VM.
- Payment options:
- On-Demand (paid per second)
- Reserved (one or three years).
- Most expensive option.
*Use cases when you need to access the physical server and get a dedicated host. - Use cases:
- Software licenses with bring your own license model.
- Companies with strong regulatory or compliance needs.
Dedicated Instances
- Instances run on hardware dedicated to you, but you may share the hardware with other instances in the same account.
- No control over instance placements.
- Difference from Dedicated Hosts:
- Dedicated Instances: Own instance on own hardware.
- Dedicated Hosts: Access to the physical server itself, providing visibility into lower-level hardware.
Capacity Reservations
- Reserve On-Demand instances in a specific AZ for any duration.
- Access to the capacity whenever needed.
- No time commitment; can reserve or cancel at any time.
- No billing discounts - the only purpose is to reserve capacity.
- To get billing discounts, combine with Regional Reserved Instances or Savings Plans.
- Charged at On-Demand rates whether or not instances are running.
- Suitable for short-term, uninterrupted workloads that need to be in a specific AZ.
Summary Analogy (Resort)
- On-Demand: Like a resort where you come and go as you please, paying the full price.
- Reserved: Like planning and staying for a long time (one to three years) at a resort, getting a good discount.
- Savings Plan: Committing to spending a specific amount (e.g., $300 per month) at the resort, with flexibility to change room types.
- Spot Instances: Last-minute discounts on empty rooms, but you can be kicked out if someone pays more.
- Dedicated Host: Booking the entire building of the resort (your own hardware).
- Capacity Reservation: Booking a room, even if unsure if you'll stay, paying full price to ensure availability.
Price Comparison (Example)
Instance: m4.large in US East 1
- On-Demand Price: $0.10
Spot Price: Up to 61% off (example).
Reserved Instances: Different pricing based on term (one or three years) and upfront payment options.
EC2 Savings Plan: Same discounts as Reserved Instances.
*Reserved convertible instances rates were also listed.
- Dedicated Host: On-Demand price.
*Dedicated Host Reservation: Up to 70% off (because you reserve your host).
*Capacity Reservation: On-Demand price.
Exam Preparation
- Understand which instance type is right based on workloads.
- Practice identifying the appropriate instance types for different scenarios.