deciphering top(1) output

Alexander Best arundel at freebsd.org
Sat Feb 12 01:08:16 UTC 2011


On Fri Feb 11 11, Chuck Swiger wrote:
> On Feb 11, 2011, at 4:41 PM, Alexander Best wrote:
> >> It means (c).  Kernel activity, short-lived transient processes, and imperfections in sampling data are the other ~13 / 10 %....
> > 
> > thanks. it seems in some cases these imperfections have quite an impact:
> > 
> > last pid: 48135;  load averages:  5.11,  5.38,  5.02  up 0+03:15:20    19:31:52
> > 271 processes: 15 running, 242 sleeping, 14 waiting
> > CPU 0: 76.4% user,  0.0% nice, 21.7% system,  2.0% interrupt,  0.0% idle
> > CPU 1: 85.0% user,  0.0% nice, 12.6% system,  2.4% interrupt,  0.0% idle
> > Mem: 1078M Active, 334M Inact, 403M Wired, 79M Cache, 212M Buf, 68M Free
> > Swap: 18G Total, 438M Used, 18G Free, 2% Inuse
> > 
> >  PID    UID    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
> > 48131      0      1  77    0 92112K 67164K CPU1    1   0:02 17.77% cc1
> > 48135      0      1  76    0 90992K 65712K RUN     0   0:01 15.87% cc1
> 
> Sure.  Compiling software is a classic example where lots and lots of CPU intensive, short-lived processes are started.  Pay attention to last pid field; if it is steadily growing, especially at a rapid rate, lots of processes are spawning....

thanks for the hint. in this example however $pid didn't get incremented for over a minute:

last pid: 14412;  load averages:  0.09,  0.26,  0.29
253 processes: 3 running, 235 sleeping, 15 waiting
CPU 0: 12.6% user,  0.0% nice,  7.9% system,  0.4% interrupt, 79.1% idle
CPU 1: 13.8% user,  0.0% nice,  5.9% system,  0.0% interrupt, 80.3% idle
Mem: 602M Active, 275M Inact, 407M Wired, 8688K Cache, 212M Buf, 669M Free
Swap: 18G Total, 910M Used, 17G Free, 4% Inuse, 4K In

  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND                                                                                                                                                                                                      
   10 root          2 155 ki31     0K    32K CPU0    0  44.7H 198.88% idle
 4414 arundel      24  20    0   334M 93080K uwait   0  34:56  0.00% chrome
 4451 arundel       2  20    0   905M   100M kqread  0  30:12  0.00% chrome
 4446 arundel       2  20    0   836M 53152K kqread  1  28:41  0.00% chrome

also i noticed that when a processes CPU activity goes up to let's say 10% and
then down again to 0% this doesn't mean that the idle process will jump to 200%
instantly, but it takes ~ 10 seconds for it to reclaim the CPU activity that
was used by the other process beforehand.

cheers.
alex

> 
> Regards,
> -- 
> -Chuck

-- 
a13x


More information about the freebsd-questions mailing list