Optimal process for finding the root of high load [closed]

I have a VPS (WHM/cPanel) where i keep our clients projects.

Some of these projects are well known frameworks and some of them are custom PHP/MySQL codes.

At certain times i am noticing high loading but i can’t really find where is the cause.

I am using top -c to check the top processes and have also installed Munin on WHM.

I would like to ask if there is a certain way to monitor in real time the causes of the high load.

At the time of high load, i am following these steps:

  • Check global traffic and system resources
  • Check Apache/MySQL/PHP logs
  • Check which project causes the high load (usually from top)
  • Go on a full stack trace of the code causing the high load

Is there a software that can do all of that in a central place? Is this the right way? What do you do in these situations?

Answer

The optimal process involves many tools that can give you a detailed view over the server.
The more informations you can get, from different sources, the easy will be to identify the cause.

You can check the logs for any problems that occurs during the time when this happens.
As well, some basic informations are available in Munin.

As well, you can install NewRelic to have a more clear picture over the process list and I/O status during the high load. This will show you which project caused the high load.

As well, you can check logstash for logs or logentries

You mention that you also use well known frameworks. Check if you are allocating enough RAM for them. I presume that most of them use a database. Is the DB server installed on the same machine? Is it on a dedicated machine?
Are you using any sort of caching (Varnish, APC, etc..) ?

Attribution
Source : Link , Question Author : kbariotis , Answer Author : Andy

Leave a Comment