Processor Affinity

  • We need to limit the number of CPUs available to SQL on a server. There are 4 x 6 core processors and we want to go 24 to 20. This is not possible via the BIOS options. I was wondering about using Processor Affinity in order to do this but I have concerns. In SQL 2005 and above they split the affinities between I/O and CPU and they should be mutually exclusive. In SQL 2000 there is only the one affinty mask option so do we risk contention between I/O and CPU threads?

    Basically, is this a feasible approach?

  • PS, we are going to be upgrading this server but the planning is likely to take months, this used to be the most important server in the company and has loads of legacy stuff on it!

  • Another way to limit CPUs is to use the Windows NUMPROC boot-time option. This limits the number of processor cores presented within Windows. If you use NUMPROC 20 on a 24-core server you are effectively turning it into a 20-core server.

    There is some advice about using processor affinity to separate IO and CPU usage. Some configurations can boos performance, but if you get the balance wrong then affinity may not help you.

    Also it is worth being aware that prior to Windows 2012, all IO activity is scheduled via core 0 on each CPU chip. If you do set affinity, then do not try to make core 0 set for CPU use only, as it will get some IO load regardless. With Windows 2012 and above, IO can be scheduled by any core.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • Thank you, we are going to use the processor affinity option but you make a very interesting point about not using processor 0, I will change our change request accordingly.

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

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