EC2 instance 100% CPU utilisation then stuck at 10%, Completely frozen Can't even ssh in
An ec2 t2.micro instance (linux) shows a very abnormal behavior. I have a very light application which usually consumes less than 3% of CPU usage. Suddenly (almost each 4th day) the instance jumps at 100% CPU usage for around 12 hours and then stucks to 10% .
When the instance is stuck, I can't even ssh in, the ssh connection just times out. Ine the image below the behavior is shown. After I stop & start the instance again, everything works again.
Some other details:
- the instance has a security group that only allows my ip address to connect via ssh.
- The app runs in a docker container and it barely receives traffic.
Any ideas would be highly appreciated :)
This can easily be caused by some sort of (default) scheduled activity on the instance. Unfortunately, you have not disclosed the OS type / Linux distribution.
You may consider upscaling the instance and/or enabling T2/T3 Unlimited mode in order to accommodate the workload without causing a disruption.
You may also consider enabling T2/T3 Unlimited mode just so you will be able to connect to the instance when the activity is happening, and then investigating the cause.
It's a linux instance (AMI: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20211129)
What kind of default scheduled activity can be running on the instance?
You can find the scheduled jobs by running commands such as
find /etc/cron.* -type f -not -name .placeholder
SSH into EC2 stops accepting connections after about 8 minutesasked 6 months ago
Ec2 instance goes down every dayasked 3 months ago
EC2 instance - Server refused our keyasked 5 months ago
Connect Windows 10 WorkSpace to Amazon Linux 2 EC2 Instanceasked 3 months ago
EC2 Instance No Response after Force Stopasked 4 months ago
EC2 instance 100% CPU utilisation then stuck at 10%, Completely frozen Can't even ssh inasked 4 months ago
Instance running very slowly - not sure on best instance typeasked 16 days ago
EC2 Instance Stuck in "stopping" stateasked 3 years ago
Very high CPU steal after moving instance from eu-west-1 to eu-west-2asked 3 years ago
EC2 Instance is stuck, can't ssh in and abnormal CPU & network utilisationasked 6 months ago