questions regarding config_value for affinity mask

  • Hi All,

    I ran ALTER SERVER CONFIGURATION SET PROCESS AFFINITY CPU = 2,3 that means the SQL server 2012 is using the 2nd and 3rd CPU's respectively..

    Now, when I run sp_configure 'affinity mask' I get the config_value as 12, so how it is getting calculated?

    is there a code for each CPU?? wanted to know about this.

  • Ashif Shaikh (8/7/2014)


    Hi All,

    I ran ALTER SERVER CONFIGURATION SET PROCESS AFFINITY CPU = 2,3 that means the SQL server 2012 is using the 2nd and 3rd CPU's respectively..

    Now, when I run sp_configure 'affinity mask' I get the config_value as 12, so how it is getting calculated?

    is there a code for each CPU?? wanted to know about this.

    You don't need to know about this. Set it to the default and never, ever mess with it. In almost 20 years of consulting on SQL Server the number of times I have seen this set to non-default values correctly is precisely zero.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • sp_configure is showing the raw bitmap value based on the CPU numbers, they are as follows

    exec sp_configure 'affinity mask'

    CPU number 7 6 5 4 3 2 1 0

    Bit map 128 64 32 16 8 4 2 1

    So, CPU 2 and 3 equate to 8 + 4 = 12

    CPU 2, 5 and 7 equate to 128 + 32 + 4 = 164

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Thanks, A Lot Perry

    :-):-):-):-):-):-):-)

  • you're welcome

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply