[WBEL-users] Strange load averages

Kirby C. Bohling kbohling at birddog.com
Tue Mar 1 17:27:02 CST 2005


Are you sure anything is wrong?  There are a number of states that
will "count" towards your load.

The most obvious things to do cat "/proc/load"

That should have values that line up with top.  If it does, top is
faithfully reporting the output of the kernel.  If it doesn't, it's
a bug in top.  It should, because it appears that w and top outputs
are lining up.

After that, anything that is in the state "UNINTERRUPTABLE" or
"RUNNING" (which I believe shows up as state "D" or "R" respectively
in "top"/"ps" listing).

Files that affect load average:

* fs/proc/proc_misc.c 
	- It shows the sprintf line so you know what all
	  the values of /proc/load are, search for "loadavg".

* kernel/timer.c
	- It shows how the actual calculation is made.  Search for
	  avenrun and count_active_tasks().  count_active_tasks is
	  where you figure out that running and interruptible tasks
	  count towards your load.

* kernel/sched.c
	- This is where the definitions for nr_uninterruptible() and
	  nr_running() are defined.

The one other question is, it looks like if you are just plowing
thru process id's that could be the problem.  If you have tasks that
are waiting in state "TASK_UNINTERRUPTIBLE" that's what counts
against you.  Not sure how squid could be causing this.  You might
want to look at how many processes are in which states.  I believe
"R" and "D" are the two ("S" is when you are "TASK_INTERRUPTIBLE").

* include/linux/sched.h
	- Search for "TASK_" to find the bit definitions.

* fs/proc/array.c
	- Search for "task_state_array", that would appear to confirm
	  my guess.
	 

(I'm way out of my depth in terms of kernel knowledge, but I can
read it enough to figure out which things count towards you load).

My guess is if you do a ps auxwwww and count up the processes in
state D, you'll find 8-9 of them.

	Thanks,
		Kirby

On Tue, Mar 01, 2005 at 04:45:42PM -0600, Dennis Gilmore wrote:
> Hi All,
> 
> Just noticed on one of my servers it is showing a very high load  it seesm its 
> not on 9 but 0  just showing wrong  it lives its life as a proxy server  
> running squid and gnugk.  anyone have any ideas  its only a recent thing  
> that ive noticed this week.
> 
> from w
>  16:41:53  up 138 days,  7:41,  1 user,  load average: 9.01, 9.01, 9.00
> USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
> dennis   pts/1    roylnx01.royalpu  4:40pm  0.00s  0.08s  0.02s  sshd: dennis 
> [priv]
> 
> from top 
> 
>  16:40:37  up 138 days,  7:40,  1 user,  load average: 9.05, 9.01, 9.00
> 122 processes: 119 sleeping, 3 running, 0 zombie, 0 stopped
> CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
>            total    0.0%    0.0%    0.1%   0.0%     0.1%    0.0%   99.6%
> Mem:   246852k av,  243472k used,    3380k free,       0k shrd,   22472k buff
>                     176660k actv,       0k in_d,    4584k in_c
> Swap:  521632k av,   13408k used,  508224k free                   99208k 
> cached
> 
>   PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
> 10326 root      15   0  1156 1156   900 R     0.1  0.4   0:00   0 top
> 
> 
> -- 
> Regards
> 
> 
> Dennis Gilmore  RHCE
> Network Manager
> Royal Publishing
> (309)693-3171 x299
> 7620 N. Harker Drive
> Peoria IL 61615
> 
> 
> Fedora Core release 3 (Heidelberg)
>  16:40:58 up 6 days,  6:23,  3 users,  load average: 0.50, 0.35, 0.21
> _______________________________________________
> Whitebox-users mailing list
> Whitebox-users at beau.org
> http://beau.org/mailman/listinfo/whitebox-users
> 


More information about the Whitebox-users mailing list