Menu
Cost Optimization: EC2 Right Sizing
Cost Optimization: EC2 Right Sizing

Appendix A: Right Sizing Logic

After the Amazon CloudWatch metrics are uploaded to Amazon Redshift, the solution submits a query using the following logic.

  1. Search for all Amazon EC2 instances with a max CPU utilization lower than 50%.

  2. For each instance returned, use the following conditions to determine a more cost-effective replacement:

    • If the instance type has 10 Gigabit network connectivity, the new instance type must also include 10 Gigabit network connectivity.

    • If the instance store (local storage volumes, not Amazon Elastic Block Store volumes) supports more than 3,000 IOPS, the new instance type must meet the following requirements:

      • Equal or increased I/O performance

      • CPU performance meets or exceeds the original instance’s max CPU utilization

      • Equal or increased memory

      • Equal or increased network throughput

      • Lowest hourly cost among all instance types that meet the above four requirements

    • If the instance store supports less than 3,000 IOPS, the new instance type must meet the following requirements:

      • CPU performance meets or exceeds the original instance’s max CPU utilization

      • Equal or increased memory

      • Equal or increased network throughput

      • Lowest hourly cost among all instance types that meet the above three requirements

  3. After identifying an appropriate replacement for each instance, calculate the estimated monthly cost savings and export all relevant data as a .csv file.