Azure Web App 上的 Http 队列长度指标是什么?

What is the Http queue length metric on Azure Web App?

Azure Web App 上的 Http 队列长度指标是多少?

我的网络应用程序经常超过 150。

我很担心,因为可以在应用服务上启用的默认警报的默认阈值为 100。

SignalR 的使用会影响这个指标吗?

编辑:

这是典型的日负荷:

Http 队列长度:未决 HTTP 操作的计数。如果您的应用程序收到的请求多于 Web 服务器可以处理的数量,这可能是您的差距。这意味着存在请求的影响,并且您当前的配置不足以支持负载。 使用 portal.azure.com 默认的 HTTP 队列长度从 1

开始

我认为您正在为套接字使用 SignalR,当套接字保持与您的网络服务器的连接时,HTTP 队列长度是 Azure 排队的网络请求的计数,因为它无法再处理,所以是的,可能是,但不确定,除非我们进一步分析。

如果请求结束进入 HTTP 队列,则表示没有线程可用于处理请求。正如 Kerem 所建议的那样,可能有一些 I/O 长的调用将线程置于等待状态(无法为请求提供服务)。这很可能是因为 CPU 并且内存不足。

您可以在 enter/exist 方法上添加 Diagnostic.Trace 并检查应用程序日志进出这些方法需要多长时间

另一种方法,远程附加 Visual Studio 并查看线程在做什么。有多少人在等?

另一种方法是进行内存转储(可能来自 kudu 站点)。然后检查线程在做什么: 在 WinDbg 中: !CLRStack -a *~ KB

您也可以在Visual Studio、select 非托管中打开.dmp 文件,并检查threds。 如果 all/nearly 所有线程都在 WaitFor***Object 中,那么它们正在等待 IO 完成。 在这种情况下,增加实例确实会 solve/decrease 问题,但最好将方法更改为对 IO 使用 Async 版本。

嗯, 阿尔多

编辑 2016 年 11 月 12 日

根据一些后续信息,HTTP 队列长度很快就会在某个时候与预期相符。

I got confirmation that after the fix, the HTTP Queue Length metric for Server Farm will be depicting the actual HttpQueueLength ( it is incorrectly showing the current Requests value at this time) for the Server Farm (App Service Plan). This fix will be rolled out in the coming weeks across all regions .


在与 Azure 支持人员交谈时,HTTP 队列长度实际上是一个容易混淆的名称,它映射到“'W3SVC_W3WP'、'Active Requests'、“_Total”。

这是完整的回复

Hello Shane, You are correct, we had noticed an issue with http queue metric , where we found out that in Auto-Scaling/Alert a Web App based on this metric was misleading as this metric was calculating the total active requests and not the queued requests and we had a discussion with our Product team about this metric and it appears that there is a little bit of ambiguity in the name of the metric HTTP Queue. In reality, the counter does we show on the portal corresponds to "W3SVC_W3WP", "Active Requests", "_Total". In other words, this counter does not represent a queue but rather requests that are running at any current time. We have also verified this by looking into our Product source code. We understand how the name of the counter could lead to confusion and we have submitted a request to our Product team to rename it. The Product team is concerned that renaming might break existing alerts customers might have but they are considering adding another metric named “Active Requests” which looks at the same value and later removing “HTTP Queue Length”. Keeping this in mind, our suggestion was to use any other metric (for example: CPU/Memory) to configure Auto-Scale/Alert rules instead of using Http Request Queue.

I had a discussion with our Product team just a few days back again and we are currently in the works on having this updated to represent that the counter value is for “Requests” and not the true Http Queue Length.

尽管这种区别很快就会变得无关紧要,因为他们也有这样的说法

Hi Shane, I was just testing this out on my end and I see that the portal has been updated at the Site level to show this metric as “Requests” . I think we are still waiting for this change to be pushed out to the Server Farm settings.

If I select Alert . In the “Resource” drop down select “sites” to select your site, then the metrics will list “Requests” , which will be the current requests.

所以需要注意的是,在当前状态下,此指标并不表示您有系统无法处理的备份请求。