martes, 17 de agosto de 2010

SQL Server 2008 R2 Max Worker Threads and performance

The parameter max worker threads is used to configure the number of worker threads available to Microsoft SQL Server processes, this helps optimize performance when large numbers of clients are connected to the server. The max worker threads option enables SQL Server to create a pool of worker threads to service a larger number of query request, which improves performance. The default value of this options is 0, and allows SQL Server to automatically configure the number of worker threads at startup. Sometimes to improve performance is better to specify a specific value, you can use the following table as reference:


Number of CPUs

32-bit computer

64-bit computer

<= 4 processors



8 processors



16 processors



32 processors




Based on Bob Duffy blog you can determine the maximum number of threads SQL Server has actually configured and how many it is currently using by the following DMVs:

select max_workers_count From sys.dm_os_sys_info

select count(*) from sys.dm_os_threads

Bob also recommends a formula to determine the max worker processes as follows:


  1. For x86 systems where total number of logical processors <=4
    • # max worker threads = 256
  2. Otherwise:
    • # max worker threads = 256 + ((# Procs – 4) * 8)
  3. For x64 systems where total number of logical processors <= 4
    • # max worker threads = 512
  4. Otherwise
    • # max worker threads = 512 + ((# Procs – 4) * 16)


Be aware that Hyper-threading causes SQL Server a lot of hassle is that it appears as two physical cores, so may result in SQL Server allocating too many threads, so in that case may need to set an specific value for the max worker threads option.


Regards ,

Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP

image image image image

Costa Rica

Technorati Tags: SQL Server

LiveJournal Tags: SQL Server Tags: SQL Server

Note: Cross posted from Eduardo Castro.


No hay comentarios:

Publicar un comentario