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 |