would like to remove or reduce 100% cpu usage from VPC or EC2, pls provide solution towards

0

would like to remove or reduce 100% cpu usage from VPC or EC2, pls provide solution towards

asked 3 months ago162 views
1 Answer
0

if your EC2 instance is running at 100% CPU then it may be that the running workload is consuming all the available CPU and so you need to uplift the instance type to one with more resources https://aws.amazon.com/ec2/instance-types/

This will be expensive, as instance types get more powerful they cost more. And also, if you are currently on free tier then uplifting to an instance type outside of free tier will mean you start paying for something you previously got for free.

So before you commit to a new instance type, analyse the running workloads to see what's causing this. Standard tools like top on Linux or Task Manager on Windows can help here. Setup CloudWatch agent to collect more detailed system logs https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html - this may show that your root cause is exhaustion of some system resources.

Running low on memory can cause an increase in CPU utilisation (as the OS spends more and more time, and more and more CPU, looking for scraps of memory it can free up), if this is your problem it may be beneficial to add a swap file https://repost.aws/knowledge-center/ec2-memory-swap-file

In short, there are a lot of tools that you can use to analyse the workloads running on your instance, and once you have a better understanding of this you can make an informed decision about the best way to proceed.

profile picture
EXPERT
Steve_M
answered 3 months ago
profile pictureAWS
EXPERT
reviewed 3 months 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