Search code examples
amazon-web-servicesamazon-ec2cpu-usageamazon-cloudwatch

AWS cloudwatch CPU Utilization doesn't match actual usage


  1. I have setup a AWS CloudWatch alarm: CPU utilization > 90 %: https://www.screencast.com/t/BPs3hlY2hEZ

  2. I have added the alarm / CPU % utilization metric to a dashboard: https://content.screencast.com/users/MartinBakDK/folders/Jing/media/5c01c414-95d7-4a20-ab7d-e0a6c9debc01/2020-05-20_2158.png

I do know - that the metric shows a 5 min average - But for more than 1 hour now the actual CPU usage of my EC2 instance has been 100% (So it should show 100% as well): https://www.screencast.com/t/BvITivn0ff

Because CloudWatch only reg. 20% and not the actual 100% => CloudWatch is useless as a monitoring-system.

Can this really be true? Please tell me what is going on and how AWS can provide such a "service".


Solution

  • Look at CpuCreditBalance metric. If this is at 0 your CPU will be capped at a fixed percentage (this is why you see the straight line).

    Your host sees itself as 100% because it cannot use anymore CPU.

    All T instances are burstable, so once they’re depleted the CPU is capped for performance. You can either change instance type or enable unlimited credits (there will be additional cost).

    Further reading: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-monitoring-cpu-credits.html