How to reduce EC2-costs drastically without purchasing reserved instances.


Setting up a cloud architecture on AWS from scratch when developing a new project can quickly lead to rapidly increasing costs. It’s essential to be aware of service costs and to take cost-saving actions from the first day.

Often, customers want to be as flexible as possible and, due to rapidly changing requirements, it is not feasible to leverage reserved instance pricing for their compute or database services.

In this article, I’ll explain how to reduce your EC2-costs drastically without purchasing reserved instances.

Before discussing the different pricing models of AWS services, it’s worth taking a look at right-sizing recommendations which are generally provided by two AWS services:

  • Cost Management / Right Sizing Recommendations [2]
  • Compute Optimizer [3]

Considering the recommendations from these services prevents overprovisioning from the beginning.

Often, there are some stages for deploying applications before they are going live in a production environment (DEV,TEST,UAT,STAGING,etc..). For non-production-environments, it proved to be effective to use spot-instances whenever possible, especially when you are using stateless, fault-tolerant workloads ([1]).

When using spots, you have to expect that they may be interrupted. Before choosing an instance type, one can assess the probability of the spot instance to be interrupted by taking a look at the “Spot Instance Advisor” [2] of AWS which shows the savings compared to on-demand instances and the probability the spot instance will be interrupted depending on the region.

The table above shows the probability of interruption and compares the price reductions of different pricing models (on-demand, spot, reserved 1year full upfront) for 3 instance types (m5.large, m4.large, c5.xlarge) gathered from AWS docs [5].

Using/Creating spot instances comes in various variations with corresponding terraform resources:

  • single spot instance / aws_spot_instance_request [6]
  • Spot fleet request / aws_spot_fleet_request [7]
  • Autoscaling group with mixed instance policy / aws_autoscaling_group [8]

Using an autoscaling group and setting descired_capacity , min_size and max-size not only ensures that spot instances are re-requested in case they are interrupted but also lets us implement another cost-saving measure very easily, how…

Continue reading:—-7f60cf5620c9—4