gpt4 book ai didi

c# - 如果在某个间隔时间内没有任何操作,Microsoft azure 应用程序服务(MVC C# Web API)将进入休眠状态

转载 作者:行者123 更新时间:2023-11-30 20:26:06 24 4
gpt4 key购买 nike

我们使用 Microsoft Azure 共享 Web api 托管,但如果该 api 中没有任何操作(在某个时间间隔内没有来自移动应用程序的 api 调用),它就会进入休眠状态,

一旦进入休眠状态,将需要很长时间才能给出响应。

通常一个API会在125毫秒内给出响应,但如果API和移动应用程序之间长时间没有任何操作,它就会进入休眠状态,此时同一API需要2分钟才能给出响应或给出超时异常。

在共享托管模型中运行的应用引擎

如何解决这个问题,请帮助我。

最佳答案

这是共享应用服务的“设计”。如果您想使用“始终开启”,请移至基本(或更高)层。

Always On.
By default, web apps are unloaded if they are idle for some period of time. This lets the system conserve resources. In Basic or Standard mode, you can enable Always On to keep the app loaded all the time. If your app runs continuous WebJobs or runs WebJobs triggered using a CRON expression, you should enable Always On, or the web jobs may not run reliably.

来源:Configure web apps in Azure App Service

关于c# - 如果在某个间隔时间内没有任何操作,Microsoft azure 应用程序服务(MVC C# Web API)将进入休眠状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50503146/

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