Spring Cleaning The AWS Bill? Two New Features for Cost Optimization Released This Week

Gabriel Tocci
4 min readMar 29, 2024

--

TL/DR;
1. Cost Allocation Tags can now be applied retroactively for up to 12 months.
2. Compute Optimizer now supports memory utilization metrics in rightsizing recommendations.

Amazon Web Services (AWS) Logo with Flying Money Icons

Cost Allocation Tags can now be applied retroactively for up to 12 months

AWS utilizes cost allocation tags to categorize your AWS resource usage, simplifying the process of organizing and tracking your AWS expenses. If you are new to AWS Cost Allocation Tags: here is a shortcut to the docs

AWS has introduced a new feature that allows customers to retroactively enable Cost Allocation Tags for a period of up to 12 months.

This means that customers can now apply cost allocation tags to historical usage data. Prior to this change, activating resource tags for cost allocation only applied to future usage data.

There is an important Caveat: The resource must have already had at least one tag.

Customers can designate this tag as a cost allocation tag, and then submit a backfill request. When you request a backfill, the prior cost and usage data will be tagged retroactively. The backfill date is customizable, up to 12 months.

Compute Optimizer now supports memory utilization metrics in rightsizing recommendations

AWS Compute Optimizer is an AWS service that analyzes your AWS Compute resources and provides recommendations to help reduce the cost of these resources. If you are new to AWS Compute Optimizer, here is a link to the user guide.

The following AWS resources are included in the Compute Optimizer:

  • EC2 Virtual Machines
  • Autoscaling Groups
  • EBS Volumes
  • Lambda Functions
  • Fargate

The latest update to AWS Compute Optimizer adds the ability to analyze memory utilization metrics for making its recommendations. Prior to this change, only CPU utilization and architecture were used by Compute Optimizer to make recommendations. This enables AWS users with memory intensive workloads generate automated computer recommendations.

Enabling this feature requires a few additional setup steps, because memory metrics are not collected and analyzed by default.

Metric data from AWS Compute resources are typically collected by AWS CloudWatch via an agent installed & configured on the EC2 Instance. To enable memory to be collected, it must be configured via a json file.

$ cat /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json
{
"metrics": {
"metrics_collected": {
"mem": {
"measurement": ["free", "used_percent"]
}
},
"append_dimensions": {
"InstanceId": "${aws:InstanceId}"
}
}
}

The CloudWatch agent then collects memory metrics from the host’s memory management subsystem. This metric data is collected by AWS CloudWatch and analyzed by AWS Compute Optimizer.

This document details the specific memory metrics that CloudWatch agent can collect. These metrics fit into the following categories:

  • Active Memory– Memory that is being used by a process. In other words, the memory used by current running apps.
  • Available Memory– The memory that can be instantly given to the processes without the system going into swap (also known as virtual memory).
  • Buffer Memory– The data area shared by hardware devices or program processes that operate at different speeds and priorities.
  • Cached Memory– Stores program instructions and data that are used repeatedly in the operation of programs that the CPU is likely to need next.
  • Free Memory– Memory that is not being used at all and is readily available. It is completely free for the system to be used when needed.
  • Inactive Memory– Pages that have not been accessed “recently”.
  • Total Memory– The size of the actual physical memory RAM.
  • Used Memory– Memory that is currently in use by programs and processes.

Additionally, AWS Compute Optimizer allows users to adjust memory utilization headroom. This allows users to provide guidance to the Compute Optimizer so it can provide sufficient safeguards in an effort to help prevent out of memory (OOM) errors and ensure application availability.

The combination of tailored recommendations and enhanced transparency into how recommendations are generated empowers users to more confidently adopt Compute Optimizer’s rightsizing recommendations.

--

--

Gabriel Tocci
Gabriel Tocci

Written by Gabriel Tocci

www.gabrieltocci.com | Senior Cloud Architect and Engineer | Industry Leader in Higher Education

No responses yet