🔨 Infrastructure
How to Monitor Memory Usage of Ec2

How to monitor memory usage of EC2

General Process

  1. Create IAM roles or users that enable the agent to collect metrics from the server and optionally to integrate with AWS Systems Manager.
  2. Download the agent package.
  3. Modify the CloudWatch agent configuration file and specify the metrics that you want to collect.
  4. Install and start the agent on your servers. As you install the agent on an EC2 instance, you attach the IAM role that you created in step 1. As you install the agent on an on-premises server, you specify a named profile that contains the credentials of the IAM user that you created in step 1.

Details

  1. Install with command lines
sudo yum install amazon-cloudwatch-agent
  1. Create IAM Roles that contains CloudWatch permission
  2. Attach the instance to IAM role Attach the instance to IAM role

References

Collect metrics, logs, and traces with the CloudWatch agent - Amazon CloudWatch (opens in a new tab)

How to monitor memory usage on AWS EC2 ?? - blog (opens in a new tab)