|
||||||||
Manuel Kasper wrote: > 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. We're already running something to serve SNMP, right? Why not make sure that the SNMP daemon polls CPU? Then we kill two birds with one stone. We can poll the SNMP daemon locally to grab current CPU utilization for the status indicator, and those of us who would like to be able to graph CPU utilization will be able to do so. -- Jesse Guardiani, Systems Administrator WingNET Internet Services, P.O. Box 2605 // Cleveland, TN 37320-2605 423-559-LINK (v) 423-559-5145 (f) http://www.wingnet.net |