微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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.”

原文地址:https://www.jb51.cc/mssql/80927.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐