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?

已提问 2 年前2222 查看次数
1 回答
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

AWS
支持工程师
Lijil_T
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则