Understanding the Top Command - from Good Site Bad Site

Understanding the Top Command

The top command is something which we use regularly to monitor our servers. The Top command provides lots of information relating to the used resource on the server. To run this, simply type in “top” and press return.

This will return lots of information, the parts that we are most concerned with are the top 3 figures in the top right, which are the load average. These numbers relate to how much processing is currently occuring on the server. The importance of these numbers is directly related to the number of processors your server has.

If you have a dual-core processor, imagine this as dual-carriageway with 2 lanes of traffic, if your processing numbers are over 2, it means that there will be a delay, because all lanes are full. All websites traffic increases and decreases, so it is a good idea to keep an eye on this. If your processing figures are always over 2 for a prolonged period, then you will need to investigate, either there are lots of users, or there could be something more worrying to look at!

If you have a quad-core processor, then imagine you have 4 lanes of traffic, if you have a single core processor, then I think you need to do an upgrade!

Once you are in “top” you can do lots of ordering and killing processors. Below we have listed some useful top commands that we use regularly. These are to be used once you have typed “top” and pressed return.

Q: quit

c: toggle display of command name or full command line.

K: kills a process, you will be asked for the process id (in the far left column)