By using AWS re:Post, you agree to the Terms of Use

How to check the cause of high ec2 CPU usage triggered by cloud-watch-agent

0

I'm running EC2 instance and sometimes the CPU usage goes by 90-100% at intervals. and it was triggered by cloud-watch-agent. I assume it's because of the old file logs. but I want to know which logs are causing this high CPU usage from cloud-watch-agent and which logs should I delete?

1 Answer
0

Hello,

AWS CloudWatch metric CPUUtilization plots the percentage of allocated EC2 compute units that are currently in use on the instance. This metric identifies the processing power required to run an application on a selected instance. Hence if you are seeing high CPU use percentage that means your application is consuming more CPU cycles and typically not because of the old logs in your instance.

If you are using Windows instance, You can use Task Manager inside the Windows Operating system to see the processes that are using the CPU the most. If necessary, you can also use Performance Monitor or Process Explorer to deep dive the processes that are causing high CPU utilization [1]. For Linux instances this can bee checked using OS performance monitoring tools such top/sar/atop [2]

Also please note that, depending on the instance type, tools in your operating system can show a different percentage than CloudWatch when the instance is not allocated a full processor core. If you are using burstable performance instances you might need to check whether you have sufficient CPU credits available for your instance [3].

Please see below links for additional information.

[1] https://aws.amazon.com/premiumsupport/knowledge-center/ec2-cpu-utilization-not-throttled/
[2] https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-configure-monitoring-tools/
[3] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-monitoring-cpu-credits.html

SUPPORT ENGINEER
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions