简体   繁体   English

Azure 功能:Function 开始延迟应用服务计划的时间

[英]Azure Functions: Function started lag time on App Service plan

We are experiencing a performance issue on Azure functions under load where there is a lag time between the call to the Azure function and the code in the function executing. We are experiencing a performance issue on Azure functions under load where there is a lag time between the call to the Azure function and the code in the function executing.

The first log entry for the Azure function call in Application insights says:应用程序洞察中 Azure function 调用的第一个日志条目说:

Function started (Id=6e2a7c0e-7190-4f4b-a146-9b957b49f4aa)

After that there is a random lag of a few seconds before the first log from our code which is the first line of code in our function.在那之后,在我们的代码的第一个日志之前有几秒钟的随机延迟,这是我们 function 中的第一行代码。

We are only seeing this lag on load.我们只看到这种负载滞后。

The Function App is running under an App Service plan with a premium pricing tier. Function 应用程序在具有高级定价层的应用程序服务计划下运行。 The functions are all HTTP triggers.函数都是HTTP触发器。

Any ideas why this could be happening and what the "Function started" log means?任何想法为什么会发生这种情况以及“功能启动”日志的含义是什么?

This is a common "problem" known as cold start:这是一个常见的“问题”,称为冷启动:

a cold start is an increase in latency for Functions which haven't been called recently.冷启动是最近未调用的函数的延迟增加。

You can find a full explanation about it in here: https://azure.microsoft.com/en-au/blog/understanding-serverless-cold-start/您可以在此处找到有关它的完整说明: https://azure.microsoft.com/en-au/blog/understanding-serverless-cold-start/

In case it's not accepted for your business, you should upgrade to premium plan where the instances are perpetually warmed.如果您的业务不接受它,您应该升级到永久加热实例的高级计划。 More info about it in here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-premium-plan更多信息在这里: https://docs.microsoft.com/en-us/azure/azure-functions/functions-premium-plan

It's a cold start like Thiago says, and if you thing startup time for a .NET app is bad, you should try a Node function!就像 Thiago 所说的那样,这是一个冷启动,如果您认为 .NET 应用程序的启动时间不好,您应该尝试使用 Node 功能!

To eliminate this you can set "Always On" to "On" by going to Configuration -> General Settings on the App Service in the portal.要消除此问题,您可以通过在门户中的应用服务上转到配置 -> 常规设置将“始终开启”设置为“开启”。 You need a Basic or higher tier in your App Service Plan, which it looks like you already have.你的应用服务计划中需要一个基本或更高的层级,看起来你已经拥有了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 发布到azure应用服务计划,找不到文件 - Publish to azure app service plan, file not found App Service Plan更改后的Azure App Service错误500 - Azure App Service Error 500 after App Service Plan change 动态调整Azure应用服务系统时间 - Dynamically Adjust System Time of Azure App Service 消耗计划中的Azure函数执行会相互干扰 - Azure function executions in consumption plan interfere with eachother 服务总线队列触发 Azure Function 的“唤醒”时间 - "Wake up" time of Azure Function triggered by Service Bus Queue 如何在Azure Function v1(.NET Framework)中使用Azure App配置服务 - How can I use Azure App Configuration service within Azure Function v1 (.NET Framework) Is it possible to deploy multiple azure functions from different projects can be deployed in single Azure function app via Azure Devops pipeline? - Is it possible to deploy multiple azure functions from different projects can be deployed in single Azure function app via Azure Devops pipeline? WinDbg Azure应用服务@ 100% - WinDbg an Azure App Service @ 100% 使用Azure AD进行Azure App Service测试 - Azure App Service testing with Azure AD 当每4分钟发送一次保持活动请求时,Azure功能仍然是消费计划中的“冷启动” - Azure Functions still “Cold Start” in Consumption plan when keep alive request sent per 4 mins
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM