Re: Follow-up: CPU poll threads ...
Posted in 1998
Schaeflein, Paul wrote:
>
> Would you please describe the difference between NET VPs and CPU VPs? And
> why is one better than the other?
[Original reply SNIPPED]
OK. Basically a NET VP (shown as class tli, soc, ipx, shm, str in the
onstat -g glo report) is a Virtual Processor whose only job is to pollthe various connections for new sessions and additional queries on
existing sessions and pass the work off to CPU VPs as needed. The CPU
VPs are doing actual query work for various sessions and in addition
can handle exactly one poll thread to do listening itself. Basically
it is best for networked connection types to have listeners in NET VPs
and shared memory connection listeners in CPU VPs. Shared memory
listeners in NET VPs will poll incessantly burning CPU time. Network
listener threads in CPU VPs use more system call overhead. The
difference has to do with the fact that the NET VPs have nothing better
to do than monitor the connections and so can block waiting for network
activity but they cannot block on shared memory operations and so have
to poll in a loop. Inversely the CPU VPs cannot block waiting for
network activity, they have better things to do with their time, and so
have to poll network connections each time they have completed some
user thread operation. Meanwhile the very fact that they are busy most
of the time doing real work means that they can only poll shared memory
connections occasionally which reduces the polling overhead for shared
memory connections versus NET VPs.
Also it is important that ALL CPU VPs run listeners for the primary
shared memory connection not just some. Since the shared memory
polling only takes place when the VP is between tasks this improves
service times. In addition if only some CPU VPs are polling shared
memory, and they do so only when they are not busy, then the polling
VP that accepts the task will schedule itself to work on it since it is
free and the other CPU VPs will rarely get any tasks assigned to them
which keeps the polling VPs even busier and reduces service times even
further.
Hope that's enough. If you need more check TFM.
Art S. Kagel