UBC-DSCI / jupyterhub-infrastructure

0 stars 0 forks source link

Adding Memory Monitoring Feature to EC2 Instance by Installing CloudWatch Agent #5

Open Peng-zju opened 3 years ago

Peng-zju commented 3 years ago

Hi,

I open this issue to give some instructions on how to enable memory usage monitoring on AWS EC2 instance. By default CPU & disk monitoring are enabled when an EC2 is started. With additional memory information, we can make better decision to resize the instance as needed and save cost.

Below are the simplified instructions for enabling memory monitoring by Installing CloudWatch Agent.

Step1 - Create IAM roles that enables the agent to collect metrics

Step 2 - Install CloudWatch Agent on EC2

Step 3 - Create the Agent Configuration File

Step 4 - Attach IAM Role to a specific EC2

Step 5 - Start the CloudWatch Agent

Step 6 - Check Memory Usage in AWS console

When to resize the instance?

Suggestion from AWS doc:

Identify instances with a maximum CPU usage and memory usage of less than 40% over a four-week period. These are the instances that you will want to right size to reduce costs.

trevorcampbell commented 2 years ago

This isn't related to course orchestration -- more to AWS jhub setup. Moving to our infrastructure repo.