Azure SqlException:服务器上的数据库当前不可用 [英] Azure SqlException: Database on server is not currently available

查看:84
本文介绍了Azure SqlException:服务器上的数据库当前不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的网站已在Azure中运行了几周而未收到此错误:

Our site has been running for a few weeks in Azure without getting this error:

SqlException:服务器服务器"上的数据库数据库"当前不是 可用的.请稍后重试连接.如果有问题 仍然存在,请与客户支持联系并为他们提供会话 跟踪ID"guid".

SqlException: Database 'database' on server 'server' is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of 'guid'.

终于有一天,活动(并发)用户超过2K.这是我可以在SO中找到的最接近的问题.虽然我们没有使用EF,但是我们正在使用Dapper.我不知道如何调试我们的应用程序,以找出导致问题的原因,而且现在问题在过去两天内都没有解决,这变得更加困难.我绝对需要保持警惕,我需要你们任何提示,说明我应该研究的地方,确定问题原因并可能解决所需要采取的措施.

It finally got that one day when there were a little over 2K of active (concurrent) users. This is the closest question that I can find in SO. We are not using EF though but rather we're using Dapper. I'm out of ideas how to debug our application to find out what caused the issue, and it's even harder now that the issue has not come up for the past 2 days. I definitely need to be on the lookout and I need you guys, any tip, on where I should be looking into, what I need to do to determine the cause of the issue, and possibly fix it.

推荐答案

听起来您需要通过某种瞬时故障处理机制来处理瞬时故障.这是帖子问类似的问题: SQL Azure数据库重试逻辑 David的答案类似于我们采用的处理方法问题.

It sounds like you need to handle transient failures via some sort of transient fault handling mechanism. Here is post asking a similar question: SQL Azure Database retry logic David's answer is similar to the approach we took do deal with the issue.

这是指向类似于David的代码和我们的解决方案的另一个链接. http://www.getcodesamples.com/src/4A7E4E66/41D6FAD

Here is another link to some code that is similar to the David's and our solution to get your head around it. http://www.getcodesamples.com/src/4A7E4E66/41D6FAD

当我们第一次迁移到SQL Azure时,我们遇到了类似的问题,但是通过对瞬态连接问题实施退避重试逻辑,大多数时间是在几秒钟后恢复的.

We had similar issues when we first moved to SQL Azure but by implementing back-off retry logic for the transient connection issues the majority of the time it recovers after a few seconds.

这篇关于Azure SqlException:服务器上的数据库当前不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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