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
asked a year ago624 views
1 Answer
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
SUPPORT ENGINEER
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions