EC2 Ubuntu T2.micro seems to be maxing CPU during application installation

0

Hello, I am installing Ghost CMS on EC2 Ubuntu T2.micro. It is using jsnode, nginx and mysql. The Ghost the minimum requirement for Ubuntu 22.04 is 1 GB RAM, so theoretically it should work, however the Ghost installation hangs up. Started again running htop in a second terminal. The MEM never went beyond 800/950 but the CPU was consistently above 90% and eventually stuck at 99.1%. This was after leaving the install running for 45 minutes. So it would appear that this is a CPU issue. I thought that the T2 vcpu were burstable, but then I started reading about credits and so on, so I really am not sure if there is anything I can do to get this installed. I am sure if I could get it installed it would run just fine. Thank you Enter image description here

Barry
asked 18 days ago124 views
2 Answers
1

Hello.

The T2 instance type starts consuming CPU credits when you use more vCPUs than the baseline throughput.
Therefore, even if Ghost CMS meets the minimum performance requirements, we believe that if there is a load during installation, the CPU credits will be consumed and the performance will drop to the baseline throughput.
As a result of the performance dropping to the baseline throughput, the installation takes longer, and I think I'm stuck in a loop where I try to force the installation to proceed despite the low performance and the CPU credits never recover.
Therefore, it may be a good idea to consider using an instance size with slightly higher performance when installing. https://aws.amazon.com/ec2/instance-types/?nc1=h_ls

profile picture
EXPERT
answered 17 days ago
  • Thank you for this information. I set my instance to "unlimited" which I understand should allow unlimited vcpu use. Correct? I also discovered the vcpu is Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz which should be adequate. I ran the Ghost install again and the installation went further but the serve did become cpu bound again at 100%. maybe it is a node.js issue. You suggested installing Ghost with a higher performing tier but I did not see a way to do that and return back to the T2.micro after.

  • https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-resize.html

    You should be able to change the instance type from t2.micro to t2.small or t2.medium using these instructions, and then put it back again once you are done.

    Be sure to keep within the same instance family, and also be aware that anything other than t2.micro falls outside of free tier.

0
Accepted Answer

@Riku's suggestion of uplifting the instance type is probably best, but it may be that the increase in CPU usage is a direct consequence of running short of memory - what I mean by this is that the Ghost install has pretty much exhausted the available memory, and so the CPU is working harder and harder as the kernel memory manager looks to find some chunks of memory anywhere that it can free up.

You may want to add some swap space to the system and see if this is enough to get you over this obstacle https://help.ubuntu.com/community/SwapFaq

profile picture
EXPERT
Steve_M
answered 16 days 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