EC2 stop responding after CPU Credit Balance is 0

0

I am new to AWS and still trying to figure out how EC2 CPU Credit works.

Currently I am running an EC2 instance with type of t2.micro . However, every week there will be a day that this instance running at 50% CPU for about 6 hours, and from the monitoring dashboard I can tell the CPU credit balance burns down to 0 then the instance will enter Instance reachability check failed state. Eventually, the EC2 just stop responding

What will be the configuration for me to prevent EC2 instance stop? or does anyone know which cheap instance type I should switch to?

Jason S
已提問 1 年前檢視次數 651 次
1 個回答
0

Hello Jason,

This is an expected behavior. Please use the following workflow to determine the best resolution.

  1. What is the maximum CPU utilization the instance is hitting? By default, the Cloudwatch metrics show Average utilization over 5 minute interval. Set this to Maximum over 5 minute interval. You will get a better picture of your CPU utilization.
  2. SSH into the instance and set up atop/sar if you havent already done so. These utilities store historical data, so the next time your system goes down, ssh into the system and use the command $ atopsar -A -b <start time> -e <end time> to view which process is actually over utilizing the CPU.
  3. If you cannot further refactor the process to use less CPU, the best thing would be to resize your instance to a higher size or turn on unlimited burst credits

NOTE: Both of these options will result in increased costs.

Since you are new to AWS, I would also recommend going through the following documentation to gain better understanding:
[+] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-credits-baseline-concepts.html [+] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html

Hope this helps.

profile pictureAWS
支援工程師
已回答 1 年前

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

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

回答問題指南