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 年前檢視次數 2220 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南