Making EC2 Wastage Memory-Aware

How to use memory usage information for EC2 underutilized instance wastage.

Article Tags
On This Page

When it comes to wastage in EC2 instances, Stax can pull in metrics from CloudWatch to track an instance's memory utilization.

You can either use the AWS CloudWatch Agent to collect these metrics or setup custom metrics. We'd recommend using the CloudWatch Agent as it integrates with AWS Systems Manager for unified metrics and logs collection, improving the overall observability of your EC2 Instances.

If you do choose to use Custom CloudWatch metrics, rather than the above agent, you’ll need to set up one of the following CloudWatch metrics:

For any instance type:

  • Telegraf/MemUsedPercent
  • Memory/MemFreeBytes + Memory/MemTotalBytes

For Linux:

  • System/Linux/MemoryUtilization
  • Linux/System/MemoryUtilization

For Windows:

  • Windows/Default/AvailableMemory
  • System/Windows/AvailableMemory
  • Windows/Default/Available Mbytes
  • System/Windows/Available Mbytes
  • Windows/Default/Available Memory
  • System/Windows/Available Memory

You can find more information about how to setup these metrics in the references below.

Amazon Web Services Documentation:

Publish Custom Metrics

Configuring a Windows Instance using the EC2Config Service

Monitoring Memory and Disk Metrics for Amazon EC2 Linux Instances

The third party agent that we use at Stax for setting up metrics is telegraf