哪些连接计入Max Concurrent Workers限制? [英] Which connections count toward the Max Concurrent Workers limitation?

查看:88
本文介绍了哪些连接计入Max Concurrent Workers限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有查询来获取服务器每个池限制的服务器最大并发工作数
的连接数?我希望能够运行类似sys.dm_exec_session / connections / sp_who2
并查看它们的分配方式。


如果
i在实例上运行sp_who2,我可以看到400多个连接,但有些(130)来自sa(主要是在master上),有些在我们的数据库上,但似乎是azure BackupService ,DMVCollector等。如何确定连接是否计入MaxConcWorker限制
(我们的当前是420)?

解决方案

< blockquote>

你好,¥b $ b



以下查询应该给出计数的连接以及与这些连接相关的会话。





SELECT


   
c.session_id,c.net_transport,c.encrypt_option,


   
c.auth_scheme,s.host_name,s.program_name,


   
s.client_interface_name,s.login_name,s.nt_domain,


   
s.nt_user_name,s.original_login_name,c.connect_time,


   
s.login_time


FROM sys.dm_exec_connections AS c


JOIN sys.dm_exec_sessions AS s


   
ON c.session_id = s.session_id






以下语句显示当前层的最大连接数。





SELECT @@ MAX_CONNECTIONS AS'Max Connections';





如果你想从.NET代码那里得到这个,你可以使用性能计数器类。





https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.performancecounter?view=netfra mework-4.7.2






希望这会有所帮助。





问候,







Alberto Morillo

SQLCoffee.com





Is there a query to get the connections that count toward the server Max concurrent workers per pool limit? I'd like to be able to run something like sys.dm_exec_session/connections/sp_who2 and see how they are allocated.

If i run sp_who2 on the instance, i can see 400+ connections BUT some (130) are from sa (mostly on master), some are on our DB but seem to be azure BackupService, DMVCollector etc. How can i tell if a connection counts toward that MaxConcWorker limitation (ours is currently 420)?

解决方案

Hello,

The following query should give the connections that count and the sessions related to those conenctions.

SELECT

    c.session_id, c.net_transport, c.encrypt_option,

    c.auth_scheme, s.host_name, s.program_name,

    s.client_interface_name, s.login_name, s.nt_domain,

    s.nt_user_name, s.original_login_name, c.connect_time,

    s.login_time

FROM sys.dm_exec_connections AS c

JOIN sys.dm_exec_sessions AS s

    ON c.session_id = s.session_id


The following statement shows you the maximum number of connections for the current tier.

SELECT @@MAX_CONNECTIONS AS 'Max Connections';

If you want to this from .NET code you can use the performance counter class.

https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.performancecounter?view=netframework-4.7.2


Hope this helps.


Regards,



Alberto Morillo
SQLCoffee.com



这篇关于哪些连接计入Max Concurrent Workers限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆