Public cloud bills can add up quickly. As you develop more cloud native applications and migrate additional legacy workloads to cloud, the complexity of managing the costs of your overall cloud environment increases exponentially. Need help with where to start identifying potential savings opportunities? In this ongoing blog series, we’ll explore best practices designed to help lower your Amazon Web Services (AWS) spend. We’ll provide you with tips and best practices to optimize your cloud environment.

Rightsizing is a simple concept on paper… determine the right size of cloud services to support your application or workload. In reality, it is a complex exercise to successfully execute on an ongoing basis. Because overprovisioning is such a common practice, rightsizing can have a significant impact on reducing your ongoing cloud costs.

Let’s start with downsizing opportunities. The most common scenario we see is cloud infrastructure that has been overprovisioned and underutilized. This happens for many reasons in both cloud native development and lift and shift type migration scenarios. Most often, a team member makes conservative, upfront assumptions about the utilization and performance needs of a given application or workload (either on purpose or by accident). After deploying and looking at historical trended data, we get a sense for the amount of resources that are required to support average and peak periods. This information is used to identify the appropriate cloud resource sizes. We then work with the client to migrate the workload to a smaller footprint in the cloud.

Leveraging AWS CloudWatch data, operating system level data, as well as any data from performance monitoring tools, we can see trended information around CPU utilization, memory utilization, disk utilization, and network IO.

If peak periods are extreme and temporary, we start to look at ways to re-architect cloud services to support the needs of that workload rather than paying for idle resources we’ve provisioned to be always-on just to support peak periods. The most common approach is an auto-scaling architecture. Taking advantage of automation, we can scale resources based on threshold triggers to spin up and spin down resources on-demand.

Finally, there are situations when you can underestimate the cloud resources needed for your workload. Similar to the first example, we can examine trended historical cloud data to determine the resource needs and identify the larger cloud footprint. We then work with the team to execute the migration of that workload.

A good starting place for rightsizing is to look for instances that have an average CPU < 5% and Max CPU < 20% for 30 days. Instances that fit this criteria are viable candidates for rightsizing or termination.

Take Control of Your Cloud

It’s important to remember that these best practices are not meant to be one-time activities, but ongoing processes. Because of the dynamic and ever-changing nature of the cloud, cost optimization activities should ideally take place continuously. Learn more about how LeanCloud can help you automate the continuous optimization of your cloud environment.