且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

到SQL Server连接的初始连接速度较慢。为什么?

更新时间:2023-02-02 22:50:25

我看到了类似的问题,但不知道它是你的一样。就我而言,这不只是在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.