I have a 24 cores/ 48 GB RAM server machine on which I want to set processor affinity for worker process to last 12 cores through IIS Advance settings, is there any formula, i don't want to set affinity through task manager as this pool is recycled quite often.
2 Answers
http://www.iis.net/configreference/system.applicationhost/applicationpools/add/cpu
smpProcessorAffinityMask
Optional uint attribute.Specifies the hexadecimal processor mask for multi-processor computers, which indicates to which CPU the worker processes in an application pool should be bound. Before this property takes effect, the smpAffinitized attribute must be set to true for the application pool.
Note: On 64-bit computers, the smpProcessorAffinityMask attribute contains the low-order DWORD for the processor mask, and the smpProcessorAffinityMask2 attribute contains the high-order DWORD for the processor mask. On 32-bit computers, the smpProcessorAffinityMask2 attribute has no effect.
If you set the value to 1 (which corresponds to 00000000000000001 in binary), the worker processes in an application pool run on only the first processor. If you set the value to 2 (which corresponds to 0000000000000010 in binary), the worker processes run on only the second processor. If you set the value to 3 (which corresponds to 0000000000000011 in binary) the worker processes run on both the first and second processors.
Note: Do not set this property to 0. Doing so disables symmetric multiprocessing (SMP) affinity and creates an error condition. This means that processes running on one CPU will not remain affiliated with that CPU throughout their lifetime.
The default value is 4294967295.
First, set smpAffinitized to true.
Processor identification goes from right to left. Starts at processor 0. To set the affinity to the last 12 processors:
0000 0000 1111 1111 1111 0000 0000 0000
Then you convert that to hex:
0x1FFE000
-
3When I look at the
snmpProcessorAffinityMask
values within IIS ('Application Pools' -> Advanced Settings) they always seem to be in decimal rather than hexadecimal. e.g. '4294967295' Yet the property description says that it's a hexadecimal mask. Why is this?– Carlos PDec 5, 2013 at 13:29 -
So, If I left default value in smpprocessoraffinitymask '4294967295', and set smpAffinitized to True, the application pool will use all available processors ? Aug 19, 2015 at 15:34
I have made a chart for each NUMA node affinity. Hope someone could benefit from it.
-
-
since is binary, you can sum the ones you want, for example: CPU1 + CPU4 == 2 + 16 = 18; binary is 10010; 12 in hex; I want CPU8 and CPU9, then 256 + 512 which means 1100000000 and in hex 300 Jan 9, 2021 at 3:08