DEV Community

Cover image for Wise Choices: How to Select the Right EC2 Instance Purchase Option in AWS
Lindiwe
Lindiwe

Posted on

Wise Choices: How to Select the Right EC2 Instance Purchase Option in AWS

Elastic Compute Cloud(EC2) is the gateway to cloud computing! It provides scalable computing power in the cloud. Whether you're running a small web server or a large-scale application, EC2 is where you start.

Choosing the right EC2 instance purchase option in AWS depends on your workload patterns, budget, and flexibility needs. By understanding the options—On-Demand, Reserved, Spot Instances, and Savings Plans, among others—you can optimize cloud spending while meeting your application's requirements.

So, let's dive in.

EC2 On Demand

  • Pay for what you use:
    • Linux or Windows - billing per second, after the first minute
    • All other operating systems - billing per hour
  • Has the highest cost but no upfront payment.
  • No long-term commitment.
  • Recommended for short-term and un-interrupted workloads, where you can't predict how the application will behave

EC2 Reserved Instances

When you purchase a Reserved Instance(RI), you can choose between a Standard or Convertible offering class.
Standard Reserved Instances typically provide the highest discount levels i.e. one-year Standard Reserved Instances provide a similar discount to three-year Convertible Reserved Instances.

Standard RI

  • long workloads
  • Up to 72% discount compared to On-demand instances
  • You reserve specific instance attributes (Instance Type, Region, Tenancy, OS)
  • Reservation Period – 1 year (– discount) or 3 years (++ discount)
  • Payment Options – No Upfront (–), Partial Upfront (–), All Upfront (++)
  • Reserved Instance’s Scope – Regional or Zonal (reserve capacity in an AZ)
  • Recommended for steady-state usage patterns (think database)
  • You can buy and sell in the Reserved Instance Marketplace

Convertible RI

  • for long workloads with flexible instances
  • You can change the EC2 instance type, instance family, OS, scope, and tenancy
  • Up to 66% discount

Comparison between the two offerings of Reserved Instances

reserved instances

EC2 Savings Plans

  • Get a discount based on long-term usage (up to 72% - same as RIs)
  • Commit to a certain type of usage ($10/hour for 1 or 3 years)
  • Usage beyond EC2 Savings Plans is billed at the On-Demand price
  • Locked to a specific instance family & AWS region (e.g., M5 in us-east-1)
  • Flexible across:
    • Instance Size (e.g., m5.xlarge, m5.2xlarge)
    • OS (e.g., Linux, Windows)
    • Tenancy (Host, Dedicated, Default)

EC2 Spot Instances

EC2 Spot Instances are unused compute capacity in the AWS cloud available to you at steep discounts compared to On-Demand prices
The MOST cost-efficient instances in AWS.
You can get a discount of up to 90% compared to On-demand
instances that you can “lose” at any point in time if your max price is less than the current spot price.
*Spot price * – The current price of a Spot Instance per hour.
Useful for workloads that are resilient to failure eg:

  • Batch jobs
  • Data analysis
  • Image processing
  • Any distributed workloads
  • Workloads with a flexible start and end time
  • Not suitable for critical jobs or databases

EC2 Dedicated Hosts

A physical server with EC2 instance capacity fully dedicated to your use.
Allows you to address compliance requirements and use your existing server-bound software licenses (per-socket, per-core, per-VM software licenses)
Purchasing Options:
On-demand – pay per second for each Dedicated Host
Reserved – 1 or 3 years (No Upfront, Partial Upfront, All Upfront)
It is the most expensive option.
Useful for software that has a complicated licensing model (BYOL – Bring Your Own License) or for companies that have strong regulatory or compliance needs

EC2 Dedicated Instances

Instances run on hardware that’s dedicated to you
May share hardware with other instances in the same account
No control over instance placement (can move hardware after Stop / Start)

EC2 Capacity Reservations

  • Reserve On-Demand instances capacity in a specific AZ for any duration
  • You always have access to EC2 capacity when you need it
  • No time commitment (create/cancel anytime), no billing discounts
  • Combine with Regional Reserved Instances and Savings Plans to benefit from billing discounts
  • You’re charged at an On-Demand rate whether you run instances or not
  • Suitable for short-term, uninterrupted workloads that need to be in a specific AZ

Which option is right for me?

I will take a resort area as an analogy.

a nice hotel
On-demand: coming and staying in the resort whenever we like, we pay the full price
Reserved: like planning ahead and if we plan to stay for a long time, we may get a good discount.
Savings Plans: pay a certain amount per hour for a certain period and stay in any room type (e.g., King, Suite, Sea View, …)
Spot instances: the hotel allows people to bid for the empty rooms and the highest bidder keeps the rooms. You can get kicked out at any time.
Dedicated Hosts: We book an entire building for the resort
Capacity Reservations: you book a room for a period at full price even if you don’t stay in it

Choose wisely, and you’ll set your organization up for success in the cloud! Which EC2 purchasing option works best for you?
Happy cloud exploring!

Top comments (2)

Collapse
 
nenyasha profile image
Melody Mbewe

This is a well-organized and informative overview of the various EC2 instance purchase options! I especially appreciate the resort analogy—it really makes the differences between the options easy to understand. This breakdown will help many users make more informed decisions based on their specific workloads and budget considerations. You did a great job highlighting not only the benefits but also the limitations of each purchasing option!

Collapse
 
tinkeringsam profile image
Sam

Very informative. Thanks @lindiwe09 !