Pages

Wednesday, February 6, 2013

How to Calculate number of threads per processor in SQL Server

How to Calculate number of threads per processor in SQL Server

Being a DBA, I was always concerned about how many threads can SQL Server afford when server is burden with more number of parallel users.

This is an important point to check whether your hardware configuration is upto mark or not at times of Peak load on the server.

Generally, a 4 way 32 bit machine will have up to 256 worker threads. That is the maximum amount of threads a 32 bit 4 processor machine can afford.

Now how to calculate for more number of processor machines ?

Here is a simple calculation

32 Bit 4 processor Max Worker Threads : 256 (This number is fixed)

Double it for 64 bit processor.

64 Bit 4 processor Max Worker Threads : 512

Now for every 1 processor add 8 threads to existing count in 32 bit server and add 16 threads to 64 bit servers

For eg:

6 processor 32 bit server will have :

256 (Fixed number for 4 processor) + 2 (remaining Processors [6-4] ) * 8 = 256 + 16 = 272 Worker Threads

8 processor 32 bit server will have:


256 (Fixed number for 4 processor) + 4 (remaining Processors [8-4] ) * 8 = 256 + 32 = 288 Worker Threads

16 processor 64 bit server will have:


512 (Fixed number for 4 processor) + 12 (remaining Processors [16-4] ) * 16 = 512+ 32 = 704 Worker Threads

32 processor 64 bit server will have:


512 (Fixed number for 4 processor) + 28 (remaining Processors [32-4] ) * 16 = 512+ 448 = 960 Worker Threads

Hope the information is useful.

Thanks.