Experiments, Lessons Learned, Best Practices & Tutorials
One of our primary goals at Flux7 Labs is to help our clients reduce their AWS costs. In fact, our product VyScale is based entirely on cost optimization using Spot instances. We inform our clients when it makes economic sense for them to buy instance reservations because reservations for periods of unexpected minimum usage can be beneficial. Reserved instances function exactly like on-demand instances, except that you pay an upfront fee to gain cheaper hourly rates.
Reserved Instance Pricing
There are several levels of reservations. Higher ones allow you to pay more up front in order to achieve a lower hourly cost. The table below shows the rates for various types of reserved and on-demand instances for m1.large instances.
|Upfront||Hourly in cents|
At some levels of utilization it makes sense to purchase reservations, rather than to rely solely upon on-demand instances. By factoring in upfront costs, we can determine which levels warrant purchasing reservations. What’s surprising is that those levels are fairly low, especially in the case of light reservations. Even at 30% utilization, light-reservation costs start to break even with those of on-demand instances. The following graph shows equivalent hourly costs for reservations at various utilization levels
To better understand these numbers in terms of total cost, as opposed to incremental cost, the figure below shows total annual expenditures at various levels. For a 100% utilization of an instance, one can reduce costs to almost half of Amazon’s standard pricing for reserved instances, and that’s without any of the bulk discounts made available to high-volume AWS customers. At lower levels, reservations cost almost twice as much as those at higher levels. However, keep in mind that, as a fraction of overall cost, the amount is still not very high. So, in cases where growth is expected, it can make sense to purchase reservations early.
Do You Have A Reservation?
Another thing to know about Amazon’s policy is that you receive a guaranteed instance when you buy a reservation, whereas there is no such guarantee for on-demand instances. When trying to acquire an on-demand instance, AWS may return an error message stating that capacity is not available for that instance type. On the other hand, once you purchase a reservation Amazon guarantees that the instance will be made available to you at the moment you request it. If you’re using an autoscaling solution it can make sense to make light utilization reservations to handle your excess capacity, even if it costs more to guarantee uptime to your customers. With Amazon’s guarantee it’s no wonder that Netflix runs almost exclusively on reservations. As a matter of policy, Netflix’s use of on-demand instances indicates that more reservations need to be purchased.
One thing to note is that Amazon always uses reservations first, so you can’t keep unused light reservations as backups while using on-demand instances for capacity.
How Amazon Handles Unused Reservations
Spot instances are one of the best uses of unutilized reserved capacity with AWS. They come with no guarantee of availability, and can be taken away from you at Amazon’s discretion at any time in order to fulfill other customers’ needs. Spot prices hover around 15% of the on-demand price, which allows Amazon to make a decent return on unused reservations and while offering reservations at a relatively low price.
The most common reason to use reservations is price, but there are also other considerations. The final decision should be based on capacity analysis from a business perspective.