SQL Server - max worker threads (max user connections)

本文介绍如何获取和设置 SQL Server 的 maxworkerthreads 参数,包括通过 sp_configure 存储过程进行配置的方法,并提供适用于不同处理器数量的计算公式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Get the current value:

sp_configure 'show advanced options',1 ;

GO

RECONFIGURE;

GO

sp_configure 'max worker threads' -SHOW MAX WORKER THREADS VALUE

 

Set the new value to 512 :


Solution1 :

sp_configure 'max worker threads', 512

RECONFIGURE; 
GO 

Solution2 :

 

 

How to calculate:

To address the previous discussion, adding more CPU does not necessarily double the Worker Count. In fact, the logic behind this simple principle is as follows:

For x86 (32-bit) upto 4 logical processors max worker threads = 256
For x86 (32-bit) more than 4 logical processors max worker threads = 256 + ((# Procs – 4) * 8)
For x64 (64-bit) upto 4 logical processors max worker threads = 512

For x64 (64-bit) more than 4 logical processors max worker threads = 512+ ((# Procs – 4) * 8)

 

 

http://technet.microsoft.com/en-us/library/ms187024.aspx

http://loadrunnertnt.blogspot.com/2007/05/monitors-ms-sql-server.html

User Connections (SQLServer: General Statistics object): this is the value of number of users connected to this database. Note that this value is the total number of user connections and not the total number of users. By default, SQL Server is configured for 255 user connections . If this value is exceeded, then increase the value of "Maximum Worker Threads" to a number higher then 255. As a rule, this value should be higher then the number of user connections. You can also set the maximum concurrent user connections to ‘0’. Which means that the number of connections is limited only by the SQL Server maximum.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值