到SQL Server连接的初始连接速度较慢。为什么? [英] Initial connection to SQL Server Connection Is Slow. Why?

查看:3668
本文介绍了到SQL Server连接的初始连接速度较慢。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所遇到的情况与装在两个网站,到SQL Server的初始连接是极其缓慢的C#应用​​程序。我写了一个测试应用程序来验证,其中增速放缓的现象,而且是第一个在SQLConnection.open声明。它需要大约41秒通过建立命名管道到服务器的连接。我们认为这可能是一个DNS问题,但它只是缓慢使用TCP / IP连接。由初始连接后连接被合并并应用正常响应。无论是工作站和服务器运行的是Windows 7专业版,酷睿2双核3.16 GHz,具有4演出拉姆体面的机器。我发现在微软论坛下面的文章:

I have run into a situation with a C# application installed at two sites where the initial connection to SQL Server is extremely slow. I wrote a test application to verify where the slowdown occurs and it is on the first SQLConnection.Open statement. It was taking about 41 seconds to establish a connection to the server via named pipes. We thought it might be a DNS issue but its just as slow using a TCP/IP connection. After the initial connection is made the connection is pooled and the application responds normally. Both the workstation and the server are decent machines running Windows 7 Pro, Core 2 Duo 3.16 Ghz with 4 gig of Ram. I did find the following article on a microsoft forum:

<一个href="http://social.msdn.microsoft.com/Forums/en/windowscompatibility/thread/f295994c-5812-4e46-8ac9-f05471d4dd54" rel="nofollow">http://social.msdn.microsoft.com/Forums/en/windowscompatibility/thread/f295994c-5812-4e46-8ac9-f05471d4dd54

关闭LLMNR协议并切断初始连接时的约一半至21秒。然而,这仍然是一个很长的时间去到SQL Server的初始连接。唯一的东西从我们的标准稍有不同的是,DNS在这种情况下,完成通一个路由器和不实际的服务器。这发生在只有两个地方到目前为止,其他没有问题运行。任何帮助将是AP preciated。

Turning off the LLMNR protocol did cut the initial connection time in about half to 21 seconds. However, this is still a long time to get an initial connection to SQL Server. The only things slightly different from our norm is that DNS in this case is done thru a router and not an actual server. This has occurred at only two places so far, others run with no issues. Any help would be appreciated.

感谢你, 丹尼斯

推荐答案

我看到了类似的问题,但不知道它是你的一样。就我而言,这不只是在C#程序正在缓慢进行SQL连接。这是连接到SQL Server也经历了缓慢的任何工具。而且,一旦到SQL服务器取得的初始连接时,任何随后的连接是细一段时间

I saw similar problem but not sure it's the same as yours. In my case, it's not just the C# program being slow to make the SQL connection. It's any tools connecting to SQL server also experiencing the slowness. Also, once the initial connection made to the SQL server, any subsequent connections are fine for a period of time.

原因是SQL服务器使用了一些管理组件。它试图验证分配给该组件的cerfiticates。它连接crl.microsoft.com。我的SQL服务器没有互联网连接。因此,等待超时。

The reason was that SQL server was using a number of managed assemblies. It's trying to verify the cerfiticates assigned to the assemblies. It's connecting the crl.microsoft.com. My SQL server didn't have the internet connection. So, it waits for the timeout.

解决的办法是让我的SQL服务器访问互联网或禁用CRL检查。你可以去到SQL Server计算机。选择工具> Internet选项>高级。检查发行商的证书吊销secuity节点下被选中。如果它选中,取消选中。

The solution was to make my SQL server to have internet access or disable the CRL checking. You can go to the SQL server machine. Select Tools > Internet Options > Advanced. Check if the publisher's certificate revocation under the secuity node is checked or not. If it's checked, uncheck it.

这篇关于到SQL Server连接的初始连接速度较慢。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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