"load average" in "uptime"

"load average" in "uptime"

Post by Bala » Thu, 08 Dec 1994 11:42:36



 Hello there,

        Could someone show me some pointers as to how load average
is calculated in "uptime", or "w"....or sources for "uptime"

        Thanks in advance.

  cs>uptime
  9:11pm  up 17:53,  67 users,  load average: 1.66, 1.64, 1.85

 
 
 

"load average" in "uptime"

Post by Shane Thom » Thu, 08 Dec 1994 21:27:28


:]      Could someone show me some pointers as to how load average
:] is calculated in "uptime", or "w"....or sources for "uptime"

:]   cs>uptime
:]   9:11pm  up 17:53,  67 users,  load average: 1.66, 1.64, 1.85

If you cat /proc/loadavg, you'll see where the numbers can be derived from.
If you're specifically referring to the places in the kernel sources, I don't
know.  I usually pull most of my load averages and memory usage from the
/proc filesystem.

--
                                       /\
       |\    /\          /|__    /(__<    >__)\    |\         |\
    ::<   \/    \/\::::/  ___>:<   ___    ___   >:/   \::::::<   \:::::::::
    ::::\           \:<    _>:/\:\(:::|  |:::)/::< |\   \:::::|   /::::::::
    ::::::|    <\/>   \:\        \::::|  |:::::::|___|    \_):|  |::/\:::::
    :::/\/      )<      >:\        >::|  |:::::::| |/      )::|  |/    \:::
    ::/        /:::\   /::::\    /:::<    >::::::|<       /::/           >:
     <_______/       \(       \/       \/        |/\____/   <__________/


 
 
 

"load average" in "uptime"

Post by Eli the beard » Fri, 09 Dec 1994 12:41:29




>:]  Could someone show me some pointers as to how load average
>:] is calculated in "uptime", or "w"....or sources for "uptime"

>If you cat /proc/loadavg, you'll see where the numbers can be derived from.

This is very system dependent advice. I have been using unix
for five years on a variety of machines and have never seen
a /proc on any of them.

Such being, this should be kept out of comp.unix.shell.

Elijah

 
 
 

"load average" in "uptime"

Post by Pat_Bar.. » Fri, 09 Dec 1994 17:24:48



>         Could someone show me some pointers as to how load average
> is calculated in "uptime", or "w"....or sources for "uptime"

Depends on what kind of system you're using.  For BSD-derived Unix
boxen, there's an array in the kernel called "avenrun", which is an
array of three floats.  Do an nlist() of /vmunix, find "_avenrun",
open /dev/kmem and lseek() to wherever _avenrun is, and read three
floating point numbers.  The easiest way to see what I'm talking about
is to look at the source for "w" (which you should be able to get off
the 4.4BSD-Lite distribution).

For SunOS 4.x, you can do this, or I think there is some kvm_* call
you can use to get the info.

--Pat.

 
 
 

"load average" in "uptime"

Post by Glen Nieb » Sun, 11 Dec 1994 07:48:12




>>         Could someone show me some pointers as to how load average
>> is calculated in "uptime", or "w"....or sources for "uptime"
>Depends on what kind of system you're using.  For BSD-derived Unix
>boxen, there's an array in the kernel called "avenrun", which is an
>array of three floats.  Do an nlist() of /vmunix, find "_avenrun",
>open /dev/kmem and lseek() to wherever _avenrun is, and read three
>floating point numbers.  The easiest way to see what I'm talking about

If you were wondering what they mean, it is the average number of
jobs which had to wait for the cpu over the last 1 minute, 5 minutes
and 15 minutes.  If they are close to 1 you are making very good use
of your CPU :-).

Glen

--
Glen Niebur           |
Mayo Clinic           | This space intentionally left blank.
Biomechanics Lab      |

 
 
 

"load average" in "uptime"

Post by Peter Mould » Sun, 11 Dec 1994 19:45:44



>    Could someone show me some pointers as to how load average
>is calculated in "uptime", or "w"....or sources for "uptime"

The load averages are the average number of processes ready to run during
the last 1, 5 and 15 minutes.

Peter.

Quote:>  cs>uptime
>  9:11pm  up 17:53,  67 users,  load average: 1.66, 1.64, 1.85

 
 
 

"load average" in "uptime"

Post by Matus Uhlar Softwa » Wed, 14 Dec 1994 20:05:46


: If you cat /proc/loadavg, you'll see where the numbers can be derived from.
: If you're specifically referring to the places in the kernel sources, I don't
: know.  I usually pull most of my load averages and memory usage from the
: /proc filesystem.

At first: /proc directory doesn't exist everywhere
It exists on some systems.

At second on some systems there is /proc directory but no /proc/loadavg
file...
--
Matus Uhlar,
Computer Centre of Technical University in Kosice, Slovakia

 
 
 

"load average" in "uptime"

Post by Klaus Lichtenwald » Mon, 19 Dec 1994 20:58:12



                    ^^^^^^^^^^^^^^^^^^^^^^^
Please check your news setup (/usr/lib/news/*)

Quote:>: If you cat /proc/loadavg, you'll see where the numbers can be derived from.
>: If you're specifically referring to the places in the kernel sources, I don't
>: know.  I usually pull most of my load averages and memory usage from the
>: /proc filesystem.
>At first: /proc directory doesn't exist everywhere
>It exists on some systems.

Yes, you explicitely have to mount it.
Add this line to your /etc/fstab:
none /proc /proc defaults

Quote:>At second on some systems there is /proc directory but no /proc/loadavg

Yeah, maybe they have a proc directory, but didn't mount /proc?

Klaus
--
__________________________________________________________________________
Klaus Lichtenwalder, Dipl. Inf., Buschingstr. 65
D-81677 Muenchen, F.R. Germany,  Fax +49-89-98292755

 
 
 

"load average" in "uptime"

Post by Ballintijn » Mon, 19 Dec 1994 23:28:10


[... some text deleted ...]

Quote:>>: If you cat /proc/loadavg, you'll see where the numbers can be derived from.
>>: If you're specifically referring to the places in the kernel sources, I
>>: don't know.  I usually pull most of my load averages and memory usage
>>: from the /proc filesystem.

>> At first: /proc directory doesn't exist everywhere
>> It exists on some systems.

> Yes, you explicitely have to mount it.
> Add this line to your /etc/fstab:
> none /proc /proc defaults

>> At second on some systems there is /proc directory but no /proc/loadavg
> Yeah, maybe they have a proc directory, but didn't mount /proc?

Not every Linux machine has the proc filesystem compiled in, it is a
compile-time-configurable-option, you know. And, if it is not in the
kernel mounting it might pose a problem...

                                                Gerco.
--
----------------------------------v------------------------------------
G.C. Ballintijn                   |      Oh, Fortuna

http://www.cs.vu.nl/~gerco/       |      Statu variabilis.....

 
 
 

"load average" in "uptime"

Post by Matus Uhlar Softwa » Thu, 22 Dec 1994 17:50:39


: >At first: /proc directory doesn't exist everywhere
: >It exists on some systems.
: Yes, you explicitely have to mount it.

Are you sure every Unix can do it ?

: >At second on some systems there is /proc directory but no /proc/loadavg
: Yeah, maybe they have a proc directory, but didn't mount /proc?

I have procfs and I have it mounted on /proc, but there is no loadav file...
There are files by the pids of every process...
--
Matus Uhlar (Fantomas on IRC),
Computer Centre of Technical University in Kosice, Slovakia

 
 
 

"load average" in "uptime"

Post by Matus Uhlar Softwa » Fri, 23 Dec 1994 19:57:54



: : >At first: /proc directory doesn't exist everywhere
: : >It exists on some systems.
: : Yes, you explicitely have to mount it.

: Are you sure every Unix can do it ?

: : >At second on some systems there is /proc directory but no /proc/loadavg
: : Yeah, maybe they have a proc directory, but didn't mount /proc?

: I have procfs and I have it mounted on /proc, but there is no loadav file...
: There are files by the pids of every process...

You must look at header of this article...this is not about linux...
someone send it to comp.unix.shell...and comp.unix.internal...
--
Matus Uhlar (Fantomas on IRC),
Computer Centre of Technical University in Kosice, Slovakia