The top command

The top command gives a list of the most active 20 processes in terms of CPU usage .

Display is updated every 5 seconds as a default value, you can change it by pressing d while top is running, enter the new display value in seconds, and press enter. The first line shows the time, for how long the computer has been running, number of users, CPU average load during the last 1minute, 5 minutes, 15 minutes. Again every terminal window is counted as a user, and this is the same info you get using uptime command.

The second line speaks for it self , some statistics of the processes.

The Third line is the CPU usage stats,

us “user” is the percentage of CPU time used by the user.

sy “system” the percentage of CPU time used by the kernel.

ni “Niced” is that used by the niced processes ( Niced processes are those which have a positive nice value , which means they have a different priority, see this post).

id “idle” is that used by idle processes.

wa “waiting” is that percentage of CPU time which is used by the processes waiting for I/O.

hi “hardware interrupt”, si “software interrupts” are the percentage of CPU time for which it has been servicing hardware and software interrupts.

The fourth and fifth lines speak for them selves .

Now we have 12 columns:

PID is the process ID.
USER is the name of the user running the process.
PR is the Process Priority.
NI nice value a negative nice value means higher priority, a positive nice value means lower priority.
VIRT is the total amount of virtual memory used by the task.
S Process Status
The status of the task which can be one of:
’D’ = uninterruptible sleep
’R’ = running
’S’ = sleeping
’T’ = traced or stopped
’Z’ = zombie
%CPU is the percentage of CPU time used by the process.
%MEM physical memory share.

Check out the top manual for the rest of the columns :

man top

There are a bunch of Interactive commands which can be run by pressing :

k to kill a process by giving it is PID.
r to renice a process by giving it is PID.
d to change the display time interval, just enter the new value in seconds.
q to quit top.

See the manual for more information

  • 0 Χρήστες που βρήκαν το παρόν κατατοπιστικό
Η απάντηση ήταν κατατοπιστική?

Σχετικά άρθρα

OpenVZ basic commands

Following are some important commands which are normally used while working on a Hardware...

Howto List existing VPS

SSH to the master server and run the following command:/usr/sbin/vzlist -aThe -a switch tells the...

Install shoutcast server on CentOS server

Shoutcast is a free-of-charge audio homesteading solution. It permits anyone on the internet to...

How to integrate XCache into PHP5 on a Fedora 8 or CentOS 5.1 system (with Apache2)

From the XCache project page: “XCache is a fast, stable PHP opcode cacher that has been...

Setup VNC server on VPS

We will discuss  setting up your VPS as a VNC server and using a client from your Windows...