【Azure 应用服务】使用App Service for Linux/Container时,如果代码或Container启动耗时大于了230秒,默认会启动失败。

网友投稿 278 2022-10-05

【Azure 应用服务】使用App Service for Linux/Container时,如果代码或Container启动耗时大于了230秒,默认会启动失败。

问题描述

使用App Service for Linux/Container时,从Docker的日志中,我们可以看见有 warmup 行为,而此行为默认时间为230秒,如果超出了这个时间,就会导致Container启动失败。

那么如果代码或Container启动耗时大于了230秒,启动失败,是否又办法来延长这个启动时长限制呢?

问题解答

有的。根据博文(​​Things You Should Know: Web Apps and Linux​​​)中关于“If your container takes a long time to start, increase the start time limit.”描述:

If your container takes a long time to start, increase the start time limit.When we start your container, we'll wait a while for it to start and initialize. We consider the startup to be successful once the container is running and once we get a response to a ping so that we know it's ready to respond to HTTP traffic. We'll wait 230 seconds for that to happen. If we don't have a successful start within 230 seconds, we'll assume there's a problem and we'll stop the container.We realize that some containers might need more time than that to start, so we allow you to increase that 230 second wait time up to a limit of 1800 seconds. To configure that, add an app setting called WEBSITES_CONTAINER_START_TIME_LIMIT and set it to the number of seconds you would like for us to wait for your container to start (up to a maximum of 1800)

所以只要在App Service的配置页面,添加 WEBSITES_CONTAINER_START_TIME_LIMIT 参数,可以设置它的最大值达到30分钟(1800秒)。

参考资料

If your container takes a long time to start, increase the start time limit.: ​​云中,恰是如此!

分类: ​​【Azure 应用服务】​​

标签: ​​App Service​​, ​​App Service for Container​​, ​​App Service for Linux​​, ​​WEBSITES_CONTAINER_START_TIME_LIMIT​​, ​​warmup 230秒​​

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Java实现PDF转Word的示例代码(无水印无页数限制)
下一篇:RocketMQ 消息集成:多类型业务消息——定时消息
相关文章

 发表评论

暂时没有评论,来抢沙发吧~