Subject | RE: [firebird-support] CpuAffinityMask |
---|---|
Author | Helen Borrie |
Post date | 2009-12-14T22:04:38Z |
At 02:58 AM 15/12/2009, Dunbar, Norman wrote:
The installer default is 1 (use only CPU 0) but there is nothing wrong with setting it to another *single* processor - as long as it is a physical CPU and not a hyperthreaded virtual one.
For Windows Classic or any non-Windows server platform, just ignore this setting.
So:
CPU0 only = 2^0 = 1 (first CPU) - OK
CPU1 only = 2^1 = 2 (second CPU) - OK
CPU0 and CPU1 = 2^0 + 2^1 = 1 + 2 = 3 [DON'T USE]
CPU2 only = 2^2 = 4 (third CPU) - OK
CPU3 only = 2^3 = 8 (fourth CPU) - OK
CPU0 AND CPU2 = 2^0 + 2^2 = 1 + 4 = 5 [DON'T USE]
CPU1 AND CPU2 = 2^1 + 2^2 = 2 + 4 = 6 [DON'T USE]
CPU1 AND CPU3 = 2^1 + 2^3 = 2 + 8 = 10 [DON'T USE]
...and so on...
[Norman, could you do something about the company message in your email footers, please?]
./heLen
>>> Dear All, I would like to ask the CpuAffinityMask settingNot quite. The setting tells Windows which processors to use for Superserver. So it is possible to set it to multiple processor BUT YOU SHOULD NOT DO IT.
>
>This setting says that "make sure that Firebird ONLY ever runs on this
>CPU. Do not allow the OS to schedule Firebird onto any other CPU in
>order to balance the load."
The installer default is 1 (use only CPU 0) but there is nothing wrong with setting it to another *single* processor - as long as it is a physical CPU and not a hyperthreaded virtual one.
>The reason being that under windows, swapping CPUs introduces a quiteWhat it seems to do on Windoze is switch the entire process to another CPU as soon as the load on the initial one approaches 100%.
>sever performance penalty. Especially as normally, the load balancer
>decides to switch Firebird to another CPU almost as soon as it gets to
>the new one!
For Windows Classic or any non-Windows server platform, just ignore this setting.
>> So, if I have quad CPU and I 'd like to use all of them then whatNo, it's calculated from a bitmask of the CPU numbers, so any number that is not an exponent of 2 will set affinity to multiple CPUs (which we don't want).
>> should I set the number of CpuAffinityMask ?
>
>Pick a number between 1 and 4, and run on one core only is best.
So:
CPU0 only = 2^0 = 1 (first CPU) - OK
CPU1 only = 2^1 = 2 (second CPU) - OK
CPU0 and CPU1 = 2^0 + 2^1 = 1 + 2 = 3 [DON'T USE]
CPU2 only = 2^2 = 4 (third CPU) - OK
CPU3 only = 2^3 = 8 (fourth CPU) - OK
CPU0 AND CPU2 = 2^0 + 2^2 = 1 + 4 = 5 [DON'T USE]
CPU1 AND CPU2 = 2^1 + 2^2 = 2 + 4 = 6 [DON'T USE]
CPU1 AND CPU3 = 2^1 + 2^3 = 2 + 8 = 10 [DON'T USE]
...and so on...
[Norman, could you do something about the company message in your email footers, please?]
./heLen