Purchase Options
In this tutorial, we are going to discuss about the different purchase options of EC2 according to your requirements. AWS EC2 offers several purchasing options to provide flexibility in cost and usage based on workload requirements.
EC2 is a commonly used AWS service. If not used wisely, it could affect deployment and the wallet. The different purchase options are provided to give customers flexibility, help match options to different workload types, and provide mechanisms for customers to reduce their EC2 costs. In this lesson, we will explore different purchase options offered by EC2, such as On-Demand, Reserved, Savings, and many more.
Types of purchase options
It is important to understand the EC2 requirements to select the best possible purchase option among multiple Purchase Options. The lifecycle of an instance determines the expected EC2 usage patterns (steady/variable, interruptible/not) and the choice of a purchasing option. Amazon EC2 offers multiple purchase options, flexibility, hardware control, and cost efficiency. Some of them are mentioned below:
On-demand instances
A commonly used purchase option that works on the pay-per-second model. An instance is launched as per the requirements with no future commitments. It gives complete control over the lifecycle of the instance from start to terminate. On-demand instances are used for uninterrupted and short-term workloads. However, it is not recommended to use on-demand instances for a highly available long-term application.
Capacity Reservation
An EC2 Capacity Reservation reserves EC2 instances in a specific availability zone. It allows to reserve instances without any commitment; thus it does not offer any discounts on the bill. However, it ensures the availability of the reserved instance in a certain AZ. There are two main types:
- On-Demand Capacity Reservations:Â These are good for critical workloads that cannot be interrupted. We pay for the reserved capacity regardless of the use, but it guarantees access to that computing power. These are normally used for business-critical events requiring more computing power than normal days.Â
- Capacity blocks for ML:Â This is specifically for Machine Learning workloads that need GPUs and cannot be interrupted.
Reserved instances
Reserved instance reduces the cost of EC2 by making a long-term commitment to consistent usage of a specified instance, including instance type and region. It’s the same as launching an EC2 instance on Demand or Reserved; however, the rates applied for reserved instances are lower. Reserved instances are essential for a business that has overly predictable and stable usage. For example, if an organization requires an M5
and G3
instances for stable usage for a year in us-east-1
for its developers, they should consider purchasing the required reserved instances for 1 year. Keep in mind that on-demand instances can be used to suffice the additional resource requirements.
An important benefit of reserved instances over on-demand is that reserved instances have priority over on-demand instances. In case the instance capacity ever reaches its limit in an availability zone, Reserved instance users have high priority for launching instances. Amazon terminates the Spot instances to adjust the requested reserved instances.
Spot instances
Spot instances are unused EC2 compute capacity that can significantly reduce the cost. Amazon provides spot instances for users to bid on the unused compute capacity available for less than on Demand price. Users can bid the maximum price for a particular instance type; a Spot instance will be available when it’s under the bidding price. The running cost of the spot instance is variable under the user bidding price, known as the Spot price. Spot instances are terminated when the variable price goes above the maximum price or EC2 requires the instance to serve as an on-demand or reserved instance. The Spot price of each instance type in each availability zone is set by Amazon EC2 and is adjusted based on the supply and demand for Spot instances.
There are two types of spot requests: an on-time spot request or a persistent request.
- An on-time spot request is a type of request, once fulfilled, is removed.
- A persistent request stays for a specified amount of time, even if the request is fulfilled. It is important to cancel the spot request before terminating the instances for persistent requests. Otherwise, once the instance is terminated, the spot request will see that we need a specific number of EC2 instances that are not available. The initial spot request may create the EC2 instances again.
This option is useful for running non-critical applications that can be terminated and launched again. For example, batch processing, background processing, and optional tasks.
Saving plans
Saving plans provide low prices for EC2 instances in exchange for a long-term commitment. It can offer up to 72 percent off On-Demand in exchange for a commitment to a specific instance family in a chosen AWS region. For example R7
in Virginia, instance size and configuration between the family can be adjusted in a region.
The key difference between Savings Plans and Reserved Instances is that Savings Plans do not restrict to a specific Availability Zone, instance type, or region. Savings Plans allow us to change the instance size within the instance family, as well as the operating system or Availability Zone, within a region, offering greater flexibility compared to Reserved Instances.
Dedicated hosts
A dedicated host is a physical server that is dedicated to the user. It allows the user to have extensive control over the server, including sockets, VM software licenses, Windows Server, SQL Server, Red Hat Enterprise Linux, or other software licenses that are bound to VMs, sockets, or physical cores, subject to your license terms. Dedicated hosts offer Bring Your Own License (BYOL) support to resources.
It allows the user to run instances of different sizes up to the hardware limitations of the server. Users may share the additional resources with AWS.
Dedicated instances
Dedicated instances are the instances that run on hardware dedicated to a single AWS account. Dedicated instances are physically isolated at the host level from the other instances that may belong to another AWS account. It does not offer hardware control or provide visibility or control over the instance placement. If an instance is stopped and started again, it’s possible that it’s launched on a different host. Dedicated instances provide limited BYOL.
For more visibility and control over the instance placement, it’s advised to use Dedicated hosts. Dedicated instances and hosts can be used to launch the instances; there are no performance, security, or physical differences between the two. However, Dedicated hosts offer more control and visibility of sockets, core, and host.
Each option offers a unique balance between cost and flexibility, allowing you to select the best fit for your specific workload and budget constraints.
That’s all about the different purchase options of EC2 according to your requirements. If you have any queries or feedback, please write us at contact@waytoeasylearn.com. Enjoy learning, Enjoy AWS Tutorials.!!