How to read output from top (Unix command)?

There are some information that I don’t understand when use top to see the server info.

  • 1 zoombie
  • 0 stopped
  • 187 sleeping
  • 3 running (are some tasks running?)

And CPU usage:
9.7% user, 36.3% system, 5.9% nice, 48.0% idle

  • What is for user,system,nice,idle?

And last:


PID  USER     PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME COMMAND
17216 mydomain  10   0  1008 1008   792 R       0 39.4  0.1   0:01 top
22301 www        3   0  3136 3136  2824 S       0 32.9  0.6   0:02 httpsd
17305 root      16   0  1652 1652  1236 R       0  6.5  0.3   0:00 sendmail
    1 root       0   0   460  460   388 S       0  0.0  0.0   0:17 init
    2 root       0   0     0    0     0 SW      0  0.0  0.0   0:00 kflushd
    3 root       0   0     0    0     0 SW      0  0.0  0.0   1:31 kupdate

How do you decode this? :slight_smile:
Thanks a bunch

You need a geek-to-English reference. :slight_smile:

Actually, to interpret the first portion, look at the processes that are currently running in the list the system presents to you. The three system processes in your example are top, httpsd, and sendmail. Note that when you first run top (or vmstat) you’ll tend to get a huge hit on the CPU - almost 40% in your example. That goes away, the CPU usage will fall back into line, and your idle% will climb back up.

User: CPU time taken by user processes (FTP, cgi scripts run under their usernames, mysql, etc.)
System: system commands (httpd, sendmail, mysql again, etc.)
Nice: processes that will run at a lower priority (that is, will be “nice” when another process needs the resources it is currently using - indicated by an “N” in the Stat(us) column)
Idle: Processes that are waiting, but not utilizing any resources (mingetty, procmon most of the time, etc.)

You might want to pick up a book on linux admin. Any basic book would be a good start, as it should detail the types of things you’ll be looking at in top, uptime, vmstat, etc.

Thanks a lot Annette

Actually I could decode the abbreviations with top (it does have some useless explanations!!) :slight_smile:
<Edited by 123finder.com on 12-02-2000 at 01:38 AM>

No problem. And what’s this about useless explanations? You mean you don’t just ache to know what “NI” and “RSS” mean? :slight_smile:

Originally posted by Annette
No problem. And what’s this about useless explanations? You mean you don’t just ache to know what “NI” and “RSS” mean? :slight_smile:

Exactly! It just explains the abbr. word by some other weird/meaningless words! :slight_smile:
But anyway, it’d not kill me if I don’t know what they really mean!!

QUICK TIP:

Type a lower case “i” while in top. It will had all idle processes (those taking 0 cpu time) making it much easier to see what the server is REALLY doing.

:slight_smile: Owen

Oh yeah, but it seems only my current process (top) is there! :slight_smile: Does that mean there is really no other process running (or maybe they’re sleeping then!)

It might seem that way sometimes (in fact, it might even be true!). But take a look at your example in the first post. Top is taking up the bulk of CPU time, but below that, both httpsd and sendmail are also chewing on something. If you watch top, you’ll see things shift in and out, as they move between processing and waiting (or going away, like someone’s FTP session). If you’re not that interested in the processes themselves (by name) and only want to watch CPU idle time, run vmstat. You can tell it to poll every x seconds by typing vmstat x.

That explained a few things to me too Annette. I wasn’t quite sure what the three levels of CPU usage were, I had an idea but wasn’t to sure about the nice part.

I bet the person who came up with the columns of numbers in the Matrix (You know, the green ones) was a sysadmin that used to sit around and watch top all day, if you watch it long enough you’ll see what I mean.