无缘无故的SQL超时

发布于 2025-02-13 20:50:37 字数 621 浏览 0 评论 0原文

我主持了一个Azure AppService,有时它会随机超时在查询上,通常需要1毫秒才能完成。 SQL Server也以Azure托管,他们在专用网络中相互交谈。可能出了什么问题。当没有负载时,它甚至会发生,我打个电话。 99%的通话起作用,但这是经常发生的1%。它无缘无故地导致40秒。

几乎有零开机连接。数据库为1200 DTU。 AppService是P3V2,并且一直在继续。数据库的性能似乎真的很好,除非查询随机需要很长时间。似乎在Azure主干中有一个连接问题。似乎每40个数据库请求几乎发生一次。瞬态错误率高于我在任何应用程序上看到的。我们从未达到20%的DTU,但错误仍然发生在1%DTU左右。它在Microsoft维护后两周前开始随机发生。在此期间,我们没有部署新代码。

我看到的例外是:

在建立与SQL Server的连接时,发生了与网络相关或实例特定的错误。该服务器未找到或无法访问。验证实例名称是正确的,并且配置了SQL Server以允许远程连接。 (提供商:TCP提供商,错误:0-连接尝试失败,因为连接的方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机未能做出响应。)连接尝试失败了,因为连接的一方确实确实如此一段时间后或建立连接失败后,由于连接的主机未能做出响应而无法做出正确的响应。

I host an azure appservice and sometimes it gets random timeouts on queries that usually take 1ms to complete. The SQL server is hosted in azure too and they talk to each other in a private network. What could be going wrong. It even happens when there is no load and I do one call. 99% of the calls work but it's the 1% that happens way to frequently. It's causing 40 second timeouts for no reason.

There are almost zero open connections. The database is 1200 DTU. The appservice is p3v2 and has always on. Performance to the database seem to be really good except if a query randomly takes really long. It almost seems like there is a connection issue in the azure backbone. It seems to happen almost once every 40 database requests. The transient error rate is higher than I have ever seen on any application. We never hit above 20% DTU but the errors still happen around 1% DTU. It randomly started happening two weeks ago after maintenance from Microsoft. We did not deploy new code during that time.

The exception I see is:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

耶耶耶 2025-02-20 20:50:37

在建立与SQL Server的连接时,发生了与网络相关或实例特定的错误。该服务器未找到或无法访问。验证实例名称是正确的,并且配置了SQL Server以允许远程连接。 (提供商:TCP提供商,错误:0-连接尝试失败,因为连接的方在一段时间后没有正确响应,或者建立的连接失败了,因为连接的主机未能做出响应。)

) href =“ https://learn.microsoft.com/en-us/troubleshoot/sql/connect/network-related-or--or--or-instance-specific-error-eror-occurred-while-while-while-while-establishing-connection” rel =“ nofollow noreferrer”> Microsoft Doc ,

原因:

SQL Server客户端是无法到达服务器。服务器的防火墙可能拒绝了该连接,或者可能无法设置服务器以接受远程连接,这可能会导致此错误。

解决方法:

确保设置机器上的防火墙以使SQL Server的此实例接收连接并启用SQL Server的远程连接,请使用SQL Server配置管理器工具。

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)

From Microsoft Doc,

Cause:

The SQL Server client is unable to reach the server. The server's firewall may have rejected the connection or the server may not be set up to accept remote connections, which might both lead to this error.

Workaround:

Ensure that the firewall on the machine is set up to let this instance of SQL Server to receive connections and to enable remote connections for SQL Server, use the SQL Server Configuration Manager tool.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文