【SQLServer】max worker threads参数配置
2022/9/13 2:23:12
本文主要是介绍【SQLServer】max worker threads参数配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
查看和设置max worker threads
USE master; //选中你想设置max worker threads的数据库。master表示在实例级别进行设置 GO EXEC sp_configure 'show advanced option'//显示当前的高级选项设置 GO EXEC sp_configure 'show advanced option', '1'; //开启高级选项 GO RECONFIGURE WITH OVERRIDE; //重新配置修改 GO EXEC sp_configure 'show advanced option' //确认 GO EXEC sp_configure //显示所有高级选项的值 GO EXEC sp_configure 'max worker threads' //显示当前max worker threads的值 GO EXEC sp_configure 'max worker threads', 3500; //设置max worker threads的值 GO RECONFIGURE WITH OVERRIDE; //重新配置修改 GO EXEC sp_configure 'max worker threads' //确认 GO EXEC sp_configure 'show advanced option', '0'; //关闭高级选项 GO
查看当前的连接和Max Worker Threads
SELECT DB_NAME ( dbid ) AS DBName, COUNT( dbid ) AS NumberOfConnections, loginame AS LoginName FROM sys.sysprocesses WHERE dbid > 0 GROUP BY dbid, loginame; SELECT SUM( current_workers_count ) AS [ Current worker thread ] FROM sys.dm_os_schedulers;
数据库镜像和alwayson的max worker threads的最佳实践
·避免max worker threads耗光,不要创建超过10个AG和100个数据库。这表示每个AG10个数据库,不过这只是建议
·如果max worker threads耗光,如果是虚拟机,增加处理器的个数
·与运行镜像和可用性组的数据库进行过多的数据库整合可能会导致max worker threads耗尽。
估算Max Worker Thread的使用
SELECT scheduler_id, current_tasks_count, current_workers_count, active_workers_count, work_queue_count FROM sys.dm_os_schedulers WHERE STATUS = 'Visible ONLINE';
查看是哪些系统任务在使用线程
SELECT is_preemptive, state, last_wait_type, count(*) AS NumWorkers FROM sys.dm_os_workers GROUP BY state, last_wait_type, is_preemptive ORDER BY count(*) DESC;
https://www.cnblogs.com/abclife/p/16683673.html
这篇关于【SQLServer】max worker threads参数配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-01-08Docker下的SqlServer发布订阅启用
- 2023-06-05Docker安装MS SQL Server并使用Navicat远程连接
- 2023-05-25深入浅出 SQL Server CDC 数据同步
- 2023-05-12通过空间占用和执行计划了解SQL Server的行存储索引
- 2023-04-24以SQLserver为例的Dapper详细讲解
- 2022-11-30SQL server高级函数查询
- 2022-11-26SQL SERVER数据库服务器CPU不能全部利用原因分析
- 2022-11-21SQL Server 时间算差值/常用函数
- 2022-11-20调试Archery连接SQL Server提示驱动错误
- 2022-10-22SQL Server 完整、差异备份+完整、差异还原(详细讲解,规避错误)