Azure的SQL数据库连接问题 - 太多的连接? [英] Azure SQL Database Connectivity Issues - Too many connections?

查看:673
本文介绍了Azure的SQL数据库连接问题 - 太多的连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站是一个白色标签,我最近推出了(同一个站点的多个版本)。没有流量很大,但 - 主要是机器人,但可能每天800用户。它托管在Azure上与除位于非蔚蓝的服务器上的管理面板的Azure数据库。这两个网站连接到相同的Azure数据库。也有运行处理数据的一些辅助角色 - 他们没有做任何事情的时候99%,但他们定期检查

I have a site which is a white label (Multiple versions of the same site) which I've launched recently. There isn't a great deal of traffic yet - mainly bots but probably 800 users per day. It is hosted on Azure with an Azure database in addition to an admin panel located on a non-azure server. Both sites connect to the same Azure database. There are also some worker roles running to process data - 99% of the time they aren't doing anything, but they check regularly.

我一直经历的随机误差其中持续几秒钟,然后它的确定再次,如:

I have always experienced random errors which last a few seconds and then it's ok again, such as:

从服务器接收结果时发生传输级错误。 (provider:TCP提供程序,error:0 - 一个现有的连接被强行关闭远程主机)

A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

然而今天上午,我们有一个更严重的问题。它始于:

This morning, however, we had a more serious problem. It started with:

System.ComponentModel.Win32Exception:一个现有的连接被强行关闭远程主机

System.ComponentModel.Win32Exception: An existing connection was forcibly closed by the remote host

这下时发生的机器人(谷歌,百度,AhrefsBot&安培; Wiseguys.nl)的索引网站。我从这些中的一个或多个错误。后来我有:

This occurred whilst bots (Google, Baidu, AhrefsBot & Wiseguys.nl) were indexing the site. I got one or more errors from these. Then I got:

System.Data.SqlClient.SqlException:服务遇到了一个错误处理您的请求。请再试一次。错误代码40143. A于当前命令发生严重错误。结果,如果有的话,应该丢弃。

System.Data.SqlClient.SqlException: The service has encountered an error processing your request. Please try again. Error code 40143. A severe error occurred on the current command. The results, if any, should be discarded.

这是过程中的ExecuteReader阶段。

This was during an ExecuteReader phase.

10多分钟后,真正的问题就来了 - 这意味着没有人可以登录到管理界面,但在Azure托管网站出现确定,当我测试虽然机器人仍然造就了错误。问题是:

10 minutes later, the real problem came - which meant that nobody could log in to the admin interface, but the Azure hosted website appeared ok when I tested it although the bots were still bringing up errors. The problem was:

System.ComponentModel.Win32Exception:等待操作超时

System.ComponentModel.Win32Exception: The wait operation timed out

这继续与随机连接工作和关闭了大约一个小时。然后我打了另一个问题:

This continued with random connections working on and off for about an hour. Then I hit another problem:

System.Data.SqlClient.SqlException:资源ID:1.数据库的请求限制为180°,已经达到。参见 http://go.microsoft.com/fwlink/?LinkId=267637 寻求帮助。

System.Data.SqlClient.SqlException: Resource ID : 1. The request limit for the database is 180 and has been reached. See 'http://go.microsoft.com/fwlink/?LinkId=267637' for assistance.

这和关闭发生了一个小时 - 主要为辅助角色。然后我试图找出是什么占用了所有这些要求,我发现这个命令:

This occurred on and off for the last hour - predominantly for the worker roles. I then tried to find out what was taking up all of these requests and I found this command:

SELECT * FROM sys.dm_exec_requests视图

SELECT * FROM sys.dm_exec_requests

当我一遍又一遍地运行它返回1或2的请求。

It only returned 1 or 2 requests when I was running it over and over.

所以我的问题是:
1)没有任何其他人的经验相对规则(一次,也许一天两次)从托管在Azure上服务器的临时断开?
2)不上面的事件列表中显示一个特殊的问题?这可能会在很多的管理员在一次被记录所有有发生。
3)我怎样才能更好地调试数据库请求的数目时,我得到了180极限消息?

So my questions are: 1) Does anyone else experience relatively regular (once, maybe twice a day) a temporary disconnect from the server hosted on Azure? 2) Does the list of events above indicate a particular problem? This could all have occurred when lots of admins were logging in at once. 3) How can I better debug the number of requests to the database when I get the 180 limit message?

感谢。

推荐答案

我几年前写了这个问题,并得到了通知一个小的改动来的称号。在经历了更多的Azure SQL数据库的,我现在知道答案了这个问题。对于其他人的利益,它只是你的数据库设置为一个层次太低。

I wrote this question a couple of years ago and got notified of a minor change to the title. Having experienced more of Azure SQL Databases, I do now know the answer to this problem. For the benefit of others, it is simply that your database is set to a tier that is too low.

天青有在性能相当巨大差异定价层。为了实现这一点,他们扼杀了不少性能指标,例如CPU供电,每分钟的请求等。

Azure has pricing tiers that have quite dramatic differences in performance. In order to achieve that, they throttle a lot of performance metrics, e.g. CPU power, requests per minute, etc.

这意味着,如果你推在你的梯队,您的要求就会开始排队,作为CPU电源/音量要求太高处理。这导致超时,然后请求限制成长,如请求等待处理。最终,它会到数据库基本上下降了一点。

This means that if you're pushing over your tier, your requests will start getting queued up as the CPU power / volume of requests is too high to process. This results in timeouts and then the request limit grows as requests wait to be processed. Eventually, it gets to the point where the database essentially goes down.

我的经验是,较低的数据库级别,例如S0和S1,是真正在动力和不应该被用于除开发或非常基本的位点的任何其他。

My experience is that the lower database levels, such as S0 and S1, are really under-powered and shouldn't be used for anything other than development or very basic sites.

有在Azure的门户一些伟大的工具,让您可以调试正在发生的事情与你的数据库,如CPU图,索引顾问和查询性能的见解。

There are some great tools in the Azure portal that allow you to debug what is going on with your database, such as the CPU graphs, index advisor and query performance insights.

这篇关于Azure的SQL数据库连接问题 - 太多的连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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