[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GNUnet-developers] Re: Round 1
From: |
James Blackwell |
Subject: |
Re: [GNUnet-developers] Re: Round 1 |
Date: |
Fri, 15 Mar 2002 01:31:58 +0000 |
User-agent: |
Mutt/1.3.27i |
> > getting the stats out of /proc/loadavg? BSD fortunatly has a getloadavg()
> > system call, which I'm multiplying by 100 and returning the value of. If
> > that is returning the right value then I think we're ok. Thanks for the
> > help.
Actually, linux has a getloadavg() as well, though you have to define
either _BSD_SOURCE or _GNU_SOURCE to use it. From the man page:
The getloadavg function returns the number of processes in
the system run queue averaged over various periods of
time. Up to nelem samples are retrieved and assigned to
successive elements of loadavg[]. The system imposes a
maximum of 3 samples, representing averages over the last
1, 5, and 15 minutes, respectively.
> Any (literally: any) measure of load will do. It's just a heuristic that uses
> it to determine when we should start dropping packets. The only real criteria
> are portability (not really possible) and speed (sometimes not possible
> either :-(). So every hack will do :-).
--
GnuPG fingerprint AAE4 8C76 58DA 5902 761D 247A 8A55 DA73 0635 7400
James Blackwell -- Director http://www.linuxguru.net