Question

I use 64-bit OS with two CPUs (each of them makes 7 logical processors) and with total number of logical processors equal to 14.

When I run this code I get 2048

SELECT max_workers_count FROM sys.dm_os_sys_info

On the other way, when I use the formula below I get totally different number which is 672

For a 64-bit operating system:
Total available logical CPUs <= 4
Max Worker Threads = 512
Total available logical CPUs > 4
Max Worker Threads = 512 + ((logical CPUs - 4)*16)

Can you explain to me why I get different numbers? I tested it on another server and got exact same numbers for both cases.

EDIT

enter image description here

P.S Thanks to Dan Guzman for his suggestions to check server settings for max worker threads. That is what EXEC sp_configure 'max worker threads' returns:

enter image description here

Was it helpful?

Solution

It seems someone has changed the maximum worker threads setting to a non-default value, which will override the default calculated value. The current configured value can be determined with:

EXEC sp_configure 'max worker threads';

I'll add the value is sometimes set mistakenly as a knee-jerk reaction to address symptoms rather than the underlying cause. Some valid reasons for configuring the value are called out in the documentation but the default calculation is appropriate for most workloads.

OTHER TIPS

The formula works for me, I have 32 logical cores, 512+((32-4)*16) = 960 which is exactly what I get from

SELECT max_workers_count FROM sys.dm_os_sys_info

Could you go into Task Manager -> Performance Tab -> CPU, and post here a screenshot of basic CPU information from your system (sockets, cores, logical processors, etc) ?

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top