Azure webapi 预热

标签 azure azure-deployment-slots

阅读文档时:https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots#swap-operation-steps ,第4步,这是指定的:

If auto swap is enabled with custom warm-up, trigger Application Initiation by making an HTTP request to the application root ("/") on each instance of the source slot.

If applicationInitialization isn't specified, trigger an HTTP request to the application root of the source slot on each instance.

If an instance returns any HTTP response, it's considered to be warmed up.

这是否意味着 1) 必须启用自定义预热才能使交换调用 root(或任何其他 url),或者 2) 如果未启用自定义预热则调用 root?无论 1) 或 2):如果未指定任何内容,则返回的所有状态代码都会告诉交换进程该插槽已预热?

更新 我阅读文档的方式( https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots#swap-operation-steps ):

... App Service does the following to ensure that the target slot doesn't experience downtime:

1. ...
2. ...
3. ...
4. If auto swap is enabled with custom warm-up, **[AppService will]** trigger Application Initiation by making an HTTP request to the application root ("/") on each instance of the source slot.

If applicationInitialization isn't specified, **[AppService will]** trigger an HTTP request to the application root of the source slot on each instance.

If an instance returns any HTTP response, it's considered to be warmed up.
5. ...

但是我好像看错了?

最佳答案

让我一一回答你的问题:

1: custom warm-up has to be enabled for the swap to call root (or any other urls)

Yes, if auto-swap is enabled and you want the staging slot to warm up before the swap process starts. Otherwise, it will warm up on the first request and delay the response until the warm up is complete.

<小时/>

2: or, if custom warm-up isn't enabled it calls root?

It will not call root by itse lf it not specified under system.webServer > ApplicationInitialization in web.config file.

<小时/>

3: Regardless of 1 or 2: if nothing is specified, all status codes returned tells the swap process that the slot is warmed up?

It will just swap the slots if nothing is specified, without considering the warm-up at all. Only when the applicationInitialization block is available in web.config file then it will wait for ApplicationInitialization module to return a completion status, and then proceed with the swap.

<小时/>

即使在暂存槽完成预热后,由于启动时的配置差异,交换暂存槽工作进程仍可能重新启动。

我观察到,当暂存和生产配置完全匹配时,交换过程会导致零停机。

交换过程中应用程序预热和重启还有其他几种情况,请引用这篇文章: https://ruslany.net/2017/11/most-common-deployment-slot-swap-failures-and-how-to-fix-them/

关于Azure webapi 预热,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58300052/

相关文章:

azure - 如果记录集为空,则触发警报 Application Insights 警报规则查询

更改网站 Web 托管计划时 Azure 门户错误

azure - VS 2015 Web 部署到 Azure Web App Staging 部署槽覆盖 PROD 槽

azure - 生产槽中的 Microsoft Azure Web 应用程序部署错误

c# - Azure 部署槽交换 - 两个槽都使用生产设置

azure - 什么是 "Nonexistent Asset"以及如何在 Azure 媒体服务中处理它?

java - Azure 服务总线 - 订阅和 DLQ

sql - Azure SQL 大量删除

visual-studio-2015 - ARM模板中特定于部署插槽的appsettin?