[ previous ] [ next ] [ threads ]
 
 From:  Manuel Kasper <mk at neon1 dot net>
 To:  jesse at wingnet dot net
 Cc:  m0n0wall at lists dot m0n0 dot ch
 Subject:  Re: [m0n0wall] Re: known issues with 1.2b3
 Date:  Fri, 04 Feb 2005 23:26:57 +0100
On 04.02.2005 11:21 -0500, Jesse Guardiani wrote:

> Personally, I've seen just the opposite. Lots of CPU utilization
> on the first click, and very little on subsequent clicks.
> 
> Where is this CPU utilization info being pulled from? Can someone
> describe the algorithm?

The CPU load is sampled at the very moment you load index.php.
Unfortunately there's no way to get the current CPU load in figures
that are meaningful to most users (i.e. percent) without sampling the
CPU tick counters, waiting for a second and then sampling again.
That's also the way top(1) does it.

Even more unfortunately though, since most browsers also try to
reload the images and CSS when you refresh the page, on slower
platforms you get 100% CPU the moment the CPU load is sampled.

I haven't been able to come up with a better solution for this yet.
We could run a daemon to keep track of the CPU %, but wasting an
entire process for this would be a bit of an overkill.

- Manuel