I have three processes running on Intel Core 2 Duo CPU. From watching output of 'top' and graphs of CPU load (drawn by MRTG, data collection via SNMP) I can see that CPU load is never more than 50%, and, most of the day, when those processes are busy CPU load has a ceiling at 50 %. I mean, CPU load grows up to 50% in the morning and stays there until late evening.
My first thought was that only one core was used at 100% thus giving 50% of both CPUs. But, as there are three processes running and from 'top' I see that both cores are being loaded, so this is not the case. schedtool shows that CPU affinity for those three processes is at default, 0x03, allowing them to use both cores. If I force one process to one core (schedtool -a 0x01), and two others to second (schedtool -a 0x02), cumulative usage grows beyond 50%.
Why three processes seem to consume only 50% of two cores? Why forcing them to different CPUs allows usage to grow higher? Any hints?
P.S. Processes in question are Counter-Strike servers.
With CPU affinity, the OS may avoid some context switches and result in higher CPU usage. I doubt the gain would be significant unless you have some high network or disk IO.
Also top summarizes data over multiple cores and I've seen odd rounding/math errors. In top, try viewing each core (hit 1 while in top). This will give you a better idea of how each CPU is used.
From the man
May want to check into using sysstat for more details CPU metrics. The command mpstat will help you here:
will spit out all cores.