Swiftorial Logo
Home
Swift Lessons
Matchups
CodeSnaps
Tutorials
Career
Resources

Amazon EC2 Pricing Models

1. Introduction

Amazon Elastic Compute Cloud (EC2) is a web service that provides resizable compute capacity in the cloud. Understanding EC2 pricing models is essential for managing costs effectively.

2. EC2 Pricing Models

2.1 On-Demand Instances

On-Demand Instances let you pay for compute capacity by the hour or second (minimum of 60 seconds), with no long-term contracts or upfront payments.

Note: Ideal for applications with unpredictable workloads.

2.2 Reserved Instances

Reserved Instances provide a significant discount compared to On-Demand pricing, in exchange for committing to a one- or three-year term.

  • Standard Reserved Instances - Up to 75% discount.
  • Convertible Reserved Instances - Up to 54% discount with the ability to change instance types.

2.3 Spot Instances

Spot Instances allow you to bid on unused EC2 capacity at a discount of up to 90% compared to On-Demand prices.

Warning: Spot Instances can be interrupted with little notice.

2.4 Savings Plans

Savings Plans offer flexibility to save up to 72% on your AWS compute usage, in exchange for a commitment to a specific amount of usage (measured in $/hour) for a one- or three-year term.

3. Best Practices

  • Analyze your workload patterns to choose the best pricing model.
  • Consider combining On-Demand, Reserved, and Spot Instances for cost optimization.
  • Regularly review your usage and adjust your Reserved Instances or Savings Plans accordingly.

4. FAQ

What is the difference between On-Demand and Reserved Instances?

On-Demand Instances are charged per hour without commitment, whereas Reserved Instances require a commitment for a one- or three-year period in exchange for a lower rate.

Can I change my Reserved Instance type?

Yes, if you choose Convertible Reserved Instances, you can change the instance types as needed.

What happens if my Spot Instance is interrupted?

Your Spot Instance can be interrupted if AWS needs the capacity. You will be notified two minutes before the interruption.

5. EC2 Pricing Decision Flowchart


        graph TD;
            A[Start] --> B{Workload Type};
            B -->|Predictable| C[Choose Reserved Instances];
            B -->|Unpredictable| D[Choose On-Demand Instances];
            B -->|Flexible| E[Choose Spot Instances];
            B -->|Variable| F[Consider Savings Plans];
            C --> G[Review Usage Regularly];
            D --> G;
            E --> G;
            F --> G;
            G --> H[Cost Optimization];