sql 在SQL Server上调整Max Worker Threads设置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 在SQL Server上调整Max Worker Threads设置相关的知识,希望对你有一定的参考价值。

 --The configuration setting that needed to be changed is:  ‘max worker threads’  
 --This is an advanced setting that is zero by default - allowing SQL Server to dynamically generate what it considers to be the optimal value for this setting.  
 --The optimal value internally set is a function of the number of CPUs and whether it is running on a 32 bit or 64 bit OS.    
 --On a 64 bit machine with 4 CPUs it may not be necessary to change the setting.  
 --If there are going to be 8 or fewer concurrent users running on a 64 bit OS with 4 CPUs – then we should not change the setting  
 --Each worker thread consumes 512K of memory, so 1500 is probably as high as we should go.  


 --You must issue T/SQL commands to modify max worker threads – cannot be interactively through dialogue windows.  
 --first, in order to modify an advance option, the 'show advances options' must be turned on  
 --run the following T/SQL commands  



 sp_configure  
 GO  

 --This will list out configuration options.  If you do not see ‘max worker threads’ as one of the options in the far left column, then you must turn on advanced options with the following T/SQL commands  

 sp_configure   'show advanced options'   , 1  
 GO   
 RECONFIGURE  
 GO  

 --now when you issue the following:  

 sp_configure  
 GO  

 --you will see a much longer list of options which includes 'max worker threads'  
 --There are 2 columns at the far right:  config_value and run_value  
 --on the 'max worker threads' row you will likely see that the config_value is zero.  
 --to change this to 1500 you must execute the following T/SQL commands:  


 sp_configure   'max worker threads'   ,1500  
 GO  
 RECONFIGURE  
 GO  

 --at this point if you issued the  

 sp_configure  
 GO  

 --you should see the list of configurations showing that 'max worker threads' has a config_value of 1500, but still the same old run_value.  
 --'max worker threads' is one of the configuration settings requiring a restart of SQL Server in order to take affect.  So, after you restart the SQL Server server instance, you can run sp_configure again to confirm that both the config_value and the run_value for 'max worker threads' is 1500.  

以上是关于sql 在SQL Server上调整Max Worker Threads设置的主要内容,如果未能解决你的问题,请参考以下文章

在 SQL Server 中调整大型查询

markdown CSS_media_query_max_width_not_working

调整SQL Server中的大型查询

无法使用 SSIS 将 SQL Server varchar(max) 传输到 MySQL 文本

Sql Server 中的标量最大值

可以在 SQL Server 2012 上恢复 SQL Server 2014 的备份吗?