What are the Amazon EC2 Pricing Models?
AWS has maintained the largest cloud market share for well over a decade, and for good reason.
How can you take advantage of all the benefits of AWS, without running up a bill that’ll break the bank?
In this article, I'm going to talk about AWS pricing models. I will highlight the key AWS pricing principles to follow, and demonstrate how to choose the right model for your business.
With Amazon EC2, you pay only for the compute time that you use. Amazon EC2 offers a variety of pricing options for different use cases. For example, if your use case can withstand interruptions, you can save with Spot Instances. You can also save by committing early and locking in a minimum level of use with Reserved Instances.
Category 1: On-Demand
The first one and the one that most people are familiar with is called On-Demand. What that means is that you only pay for the duration that your instance runs for. This can be per hour or per second, depending on the instance type and operating system you choose to run. Plus, no long-term commitments or upfront payments are needed. This type of pricing is usually for when you get started and want to spin up servers to test out workloads and play around. You don't need any prior contracts or communication with AWS to use On-Demand pricing. You can also use them to get a baseline for your average usage, which leads us to our next pricing option, Savings Plan.
On-Demand Instances are ideal for short-term, irregular workloads that cannot be interrupted. No upfront costs or minimum contracts apply. The instances run continuously until you stop them, and you pay for only the compute time you use.
Sample use cases for On-Demand Instances include developing and testing applications and running applications that have unpredictable usage patterns. On-Demand Instances are not recommended for workloads that last a year or longer because these workloads can experience greater cost savings using Reserved Instances.
Pros
Cons
When to Use
Category 2: EC2 Savings Plans
Savings Plan offers low prices on EC2 usage in exchange for a commitment to a consistent amount of usage measured in dollars per hour for a one or three-year term. This flexible pricing model can therefore provide savings of up to 72% on your AWS compute usage. This can lower prices on your EC2 usage, regardless of instance family, size, OS, tenancy, or AWS region. This also applies to AWS Fargate and AWS Lambda usage, which are serverless compute options
AWS offers Savings Plans for several compute services, including Amazon EC2. Amazon EC2 Savings Plans enable you to reduce your compute costs by committing to a consistent amount of compute usage for a 1-year or 3-year term. This term commitment results in savings of up to 72% over On-Demand costs.
Any usage up to the commitment is charged at the discounted Savings Plan rate (for example, $10 an hour). Any usage beyond the commitment is charged at regular On-Demand rates.
Pros
Cons
When to Use
Category 3: Reserved Instances
Another option is Reserved Instances. These are suited for steady-state workloads or ones with predictable usage and offer you up to a 75% discount versus On-Demand pricing. You qualify for a discount once you commit to a one or three-year term and can pay for them with three payment options: all upfront, where you pay for them in full when you commit; partial upfront, where you pay for a portion when you commit; and no upfront, where you don't pay anything at the beginning.
Reserved Instances are a billing discount applied to the use of On-Demand Instances in your account. You can purchase Standard Reserved and Convertible Reserved Instances for a 1-year or 3-year term, and Scheduled Reserved Instances for a 1-year term. You realize greater cost savings with the 3-year option.
At the end of a Reserved Instance term, you can continue using the Amazon EC2 instance without interruption. However, you are charged On-Demand rates until you do one of the following:
Pros
Cons
When to Use
Recommended by LinkedIn
Category 4: Spot Instances
The next option is Spot Instances, and they allow you to request spare Amazon EC2 computing capacity for up to 90% off of the On-Demand price. The catch here is that AWS can reclaim the instance at any time they need it, giving you a two-minute warning to finish up work and save state. You can always resume later if needed. So when choosing Spot Instances, make sure your workloads can tolerate being interrupted.
Spot Instances are ideal for workloads with flexible start and end times, or that can withstand interruptions. Spot Instances use unused Amazon EC2 computing capacity and offer you cost savings at up to 90% off of On-Demand prices.
Suppose that you have a background processing job that can start and stop as needed (such as the data processing job for a customer survey). You want to start and stop the processing job without affecting the overall operations of your business. If you make a Spot request and Amazon EC2 capacity is available, your Spot Instance launches. However, if you make a Spot request and Amazon EC2 capacity is unavailable, the request is not successful until capacity becomes available. The unavailable capacity might delay the launch of your background processing job.
After you have launched a Spot Instance, if capacity is no longer available or demand for Spot Instances increases, your instance may be interrupted. This might not pose any issues for your background processing job. However, in the earlier example of developing and testing applications, you would most likely want to avoid unexpected interruptions. Therefore, choose a different EC2 instance type that is ideal for those tasks.
Unlike Amazon EC2 Savings Plans, Spot Instances do not require contracts or a commitment to a consistent amount of compute usage.
Pros
Cons
When to Use
Category 5: Dedicated Hosts
And finally, we have Dedicated Hosts, which are physical hosts dedicated for your use for EC2. These are usually for meeting certain compliance requirements and nobody else will share tenancy of that host.
Dedicated Hosts are physical servers with Amazon EC2 instance capacity that is fully dedicated to your use.
You can use your existing per-socket, per-core, or per-VM software licenses to help maintain license compliance. You can purchase On-Demand Dedicated Hosts and Dedicated Hosts Reservations. Of all the Amazon EC2 options that were covered, Dedicated Hosts are the most expensive.
Increase Value for Money
You should start cost optimization as early as possible (before migrating the workload to AWS if possible).
One of the most important exercises is matching capacity with demand. AWS has recognized how fundamental this is and developed a number of monitoring tools to help you:
In addition to monitoring tools, AWS also provides tools that automatically take action to cut costs. These include:
Maximize the Power of Flexibility
Using a cloud provider like AWS gives you the flexibility to access the services you need - when you need them, only paying for what you actually use. AWS gives you the ability to adjust services to align them with your business and reduce costs. For example, you can add or remove new EC2 instances as your demand fluctuates, or move data to cheaper S3 storage classes when you see it isn’t accessed often. Another option is to take advantage of serverless or managed services instead of running your own infrastructure. This can be anything from Lambda functions to ECS/EKS clusters to Simple Queue Service.
Being aware of the adjustment options available and taking advantage of them to suit your applications is key to running a scalable business.
Useful Tools
AWS pricing models are complex enough, so manually estimating all the costs can not only be cumbersome, but also error-prone. Instead, you can make use of some AWS’s native tools to estimate costs, or create an expense budget. Here are some of these:
Conclusion
I hope that this article has provided you with the information you need to choose a pricing model that will help you cut costs without compromising quality or reliability. Understanding the AWS pricing models and their suitability for various types of workloads allows you to strike the right balance between flexibility and cost.
The AWS pricing model you choose will depend entirely on your specific business needs.
For example, if you are testing a new application, starting with the On-Demand pricing model can give you flexibility to know what resources will be needed over a period of time. Once you have determined the usage profile, you can plan for long-term commitments and cost-saving techniques. If you have a highly fault-tolerant application that runs on a cluster of instances that can withstand losing a number of nodes unexpectedly, Spot Instances can be a great choice. There is no one-size-fits-all, and in most cases there will always be some level of trial and error.
Curated and Shared by #NileshRoy from #Mumbai (#India) on #06July2023