I have a Magento 1.9 website and hosted it on Amazon server. I have m3.large ec2 instance and using RDS with db.m3.large instance.
My 2-CPU usage reached 100% very frequently and I need to restart my server again. For a while, it works fine but after few minutes it reaches 100%. Because of 100% usage of CPU my website goes slow and not able to open it easily.
What do I have to do?
htop screenshot:
2
Answers
You can set up an auto scaling. Auto Scaling helps you maintain application availability and allows you to dynamically scale your Amazon EC2 capacity up or down automatically according to conditions you define.
Please read more about auto scaling here
To distribute the load attach auto scaling group to an Elastic load balancer (ELB), which looks like below,
I Think you’d better login ec2 instance by SSH.
Then using top to watch which process take much CPU.
You can also using accton command to turn process account on.
Then using sa command and lastcomm to display the details.
For Example:
Find the performance issue and try to solve it, and hope its helpful to you