• subscribe
May 20, 2003 12:00 AM

Hyper-Threading and SQL Server's Affinity Mask Option

SQL Server Pro
InstantDoc ID #38758

The affinity mask option, available through sp_configure, lets you control which processors SQL Server uses. If you use the affinity mask option on a machine that uses Intel's Hyper-Threading technology, you might get unanticipated behavior. If your machine has four physical processors and you enable Hyper-Threading, the OS will see eight logical processors. SQL Server assigns a separate User Mode Scheduler (UMS) for each processor in the system. The UMS works with the OS to schedule SQL Server threads. Normally, each processor has one UMS.

Table 1 shows a map of logical processor number to physical processor. The execution context on physical processor 0 serves logical processors 0 and 4. Setting affinity mask equal to a value of 00010001 tells SQL Server to use logical processors 0 and 4, which are using the same physical processor. In this case, you might think you were setting affinity mask to use two processors when you're in fact using a single physical processor. Affinity mask is an advanced setting that you don't need to change for most installations. However, recognizing the implications of Hyper-Threading is important if you take advantage of the affinity mask option.



ARTICLE TOOLS

Comments
  • JOHN
    6 years ago
    Jul 11, 2006

    How can you guarantee that affinity on a 4 proc machine will always be the same as you stated?

    0-0
    1-1
    2-2
    3-3
    4-0
    5-1
    6-2
    7-3

    Per Intel, AMD...etc...Affinity is not always as such and could be in the format

    0-0
    1-0
    2-1
    3-1
    4-2
    5-2
    6-3
    7-3

  • JENNIFER
    8 years ago
    Nov 08, 2004

    I expected a much more detailed analysis of the impact of Hyper-Threading on SQL Server since there have been performance issues identified with hyper-threading slowing SQL Server 7

You must log on before posting a comment.

Are you a new visitor? Register Here
  • SP1?
    I know there is a SP1 for SQL 2008 R2 available....and there is a "feature pack" as well... ...
  • SQL database mirroring
    I have SQL Server 2008 R2 Enterprise 64bit on Windows 2008 R2 Enterprise 64bit.  Each SQL Server has...
  • Dell Compellent Disk Drive
    Does anybody has experience with Dell Compellent Disk Drive? Basically, this system manages all disk...
  • Sql server performance tuning
    I need to find a tool that help me to optimize sql server,queries,improve the performance and solve ...