sql-server-2008-r2 – SQL Server“Audit Logout”操作需要很长时间.

我们有一个存储过程,每天由15个用户每天调用约30万次.我已经倾注了每一行,它是有效率,我可以得到它.

存储过程通过基本的Winterms上的遗留VB6应用程序的4.0上的ASP.NET页面进行访问.

当我查看sql跟踪文件时,我看到以下内容

> exec sp_reset_connection(使用连接池)
>审核登录
>执行存储过程
>审核注销

我在步骤4中看到,读取和写入的方式很高,这是有道理的,因为它是在池中重用的连接的累积.

我关心的是多长时间,有时候需要50ms,其他时间400ms,完全是随机的.从文档中我看到“审计注销”是整个三个步骤的持续时间.但是步骤1-3非常快,像0-5ms.为什么“审计登出”的持续时间要长呢?

解决方法

我现在“处理”一个类似的问题,偶然发现
帖子: http://social.msdn.microsoft.com/Forums/en/sqldatabaseengine/thread/84ecfe9e-ff0e-4fc5-962b-cffdcbc619ee

也许这个(上面提到的帖子)是解决方案:

“One error in my analysis has been identified. When a connection is pulled out of the pool,the server is sent a sp_reset_connection. That reset invokes an audit_logout followed by an audit_login. The next audit_logout doesn’t occur until the next time the connection is pulled out of the pool… so the long intervals I am seeing include the time the application processes the results of a query,releases the connection to the connection pool,does whatever,and finally pulls the connection back out of the pool to start the next transaction.”

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...