gpt4 book ai didi

Azure webapi 预热

转载 作者:行者123 更新时间:2023-12-03 05:00:46 29 4
gpt4 key购买 nike

阅读文档时: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/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com