Discussion:
Large processor queue length with low CPU usage
(too old to reply)
Tianxiang Zhang
2003-10-02 17:56:12 UTC
Permalink
The processor queue length counter of the System object in
the PerfMon shows the number of ready threads in the
processor queue. A sustained processor queue of greater
than two threads generally indicates processor
congestion. However, on many Windows 2000 systems I saw
the processor queue length was very high consistantly (6
to 8) but the CPU usage was very low (less than 10%).
Anyone knows why?

Thanks.
Kirk Ferdmann
2003-10-03 03:28:56 UTC
Permalink
Post by Tianxiang Zhang
The processor queue length counter of the System object in
the PerfMon shows the number of ready threads in the
processor queue. A sustained processor queue of greater
than two threads generally indicates processor
congestion. However, on many Windows 2000 systems I saw
the processor queue length was very high consistantly (6
to 8) but the CPU usage was very low (less than 10%).
Anyone knows why?
First of all anything below 10 is normal for the processor queue length
counter in the perfmon (according to the perfmon's documentation)

Secondly if you have multiple processors you have to divide the queue length
by the number of the processors. Because there is only one scheduler in the
SMP system too.

And lastly the queue length is an instanteneous counter. It shows the number
of ready threads right now, which is a sort of misnomer because IMHO it
takes into consideration only the highest priority queue (note that there is
queue per priority). Those threads will eventually block on something like
I/O or synchronization mechanism.

Now the CPU usage counter is different: <quote> It is calculated by
measuring the duration of the idle thread is active in the sample
_interval_, and subtracting that time from interval duration </quote> Idle
thread will run only when there is no ready thread with higher priority. And
this is essentially the basic assumption of any preemtive system. I can have
single thread (in addition to the Idle one) but if it runs code like this:

while ( true );

The CPU usage counter will show 100%. Note that in this hypothetical case
the queue length is 1 :o)

-Kirk

Loading...