azure - Azure 网站自动缩放需要多长时间?

标签 azure azure-web-app-service

我正在使用 MVC3、ASP.NET4.5、C#、Razor、EF6.1、SQL Azure

我一直在使用 JMeter 进行一些负载测试,并且发现了一些令人惊讶的结果。

我对 30 个并发用户进行了测试,加速时间超过 10 秒。测试计划相当简单:

1) Login
2) Navigate to page
3) Do query
4) Navigate back
5) Logout.

我正在使用“小型”“标准”实例。

我发现,当我的 Azure 设置配置为“自动缩放”时,它的行为就像我使用一个没有自动缩放的“小型”实例进行的测试。当我设置两个没有自动缩放的“小型”实例时,它的速度是测试的两倍,或者更确切地说,每个请求的平均处理时间是测试的两倍。所以看起来它不是自动缩放的。我尝试将 CPU 触发器设置为较低的目标,即 40-70。还是没有喜悦。

经过进一步调查,首次引入“自动缩放”时,它似乎评估了前一小时的指标,现在我看到了“10 分钟”的引用。我认为一旦CPU开始达到目标值,它就会立即触发新实例,这一定是“自动缩放”的全部意义所在。如果我有大量并发使用,我现在需要额外的实例,因此是使用 PAAS 的原因。由于我的测试时间不到 10 分钟,“自动缩放”从未启动。那么自动缩放需要多长时间才能启动?

谢谢。

最佳答案

Azure 将每 5 分钟检查一次 CPU 指标,如果超过设置的阈值,则会增加此时的实例计数。

有趣的是,Azure 会在实例计数低于阈值 2 小时后减少

来源:How to Scale Websites

引用相关部分:

Note: When Scale by Metric is enabled, Microsoft Azure checks the CPU of your website once every five minutes and adds instances as needed at that point in time. If CPU usage is low, Microsoft Azure will remove instances once every two hours to ensure that your website remains performant. Generally, putting the minimum instance count at 1 is appropriate. However, if you have sudden usage spikes on your website, be sure that you have a sufficient minimum number of instances to handle the load. For example, if you have a sudden spike of traffic during the 5 minute interval before Microsoft Azure checks your CPU usage, your site might not be responsive during that time. If you expect sudden, large amounts of traffic, set the minimum instance count higher to anticipate these bursts.

关于azure - Azure 网站自动缩放需要多长时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26139490/

相关文章:

sql-server - 实体命令执行异常 : Azure SQL with Entity Framework slow and rejecting requests

azure - Azure Web 应用程序中某些 URL 的 TLS 1.0

azure - 将数据发送到事件中心时,Azure 诊断设置使用的分区键是什么?

azure - 部署 Azure 函数应用程序应用程序设置的最佳方法

azure - 使用 Github Actions 将多个项目部署到 Azure

azure - 如何停止为 Azure Web App 运行多个应用程序见解?

azure - :( Application Error when trying to deploy docker-compose app in azure app service

reactjs - 在 Azure Web 应用程序中运行 React Bundle 不会加载 json 文件

asp.net - Azure 网站实例到底是什么

azure - 应用服务无法通过 VPN 连接连接到资源