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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠