永远在线应用程序服务计划上的Azure功能超时,但未设置功能超时设置

编程入门 行业动态 更新时间:2024-10-25 06:32:06
本文介绍了永远在线应用程序服务计划上的Azure功能超时,但未设置功能超时设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

就像标题中描述的那样-我在App Service Plan上具有Azure功能,配置为Always On,并且在host.json中未设置functionTimeout,并且它似乎超时/在30分钟到1小时后都没有完成((...但我认为这可能是误报...)

Like the title describes - I have an Azure Function on the App Service Plan, configured for Always On and no functionTimeout set in my host.json, and it appears to timeout / not finish anytime after 30 minutes to 1 hour.(...but I feel this may be a false positive...)

HTTP触发功能有时可能需要1-2个小时以上才能完成.根据 Azure函数最佳做法我应该将其分解为更小/更易于管理的部分-我明白了.但是,我希望App Service计划上的Function能够像宣传的那样工作-对执行时间没有硬性限制.也许这与在应用程序服务上发生意外的天蓝色函数超时问题相同-plan ,但没有答案,我改用HTTP触发器.

The HTTP Triggered function can sometimes take over 1-2 hours to complete. I understand that this probably isn't the best design and according to the Azure Function Best Practices I should break this out into smaller / more manageable pieces - I get that. However, I expect the Function on the App Service plan to work as advertised - no hard limit on execution time. Perhaps this is the same question as Unexpected azure-function timeouts on app-service-plan, but that has no answer and I am using an HTTP Trigger instead.

当前,HTTP触发方法在工作完成之前不会返回. (这是一个问题-HTTP触发器需要更快地返回吗?)

Currently, the HTTP Triggered method does not return until the work is complete. (Is this a problem - the HTTP trigger needs to return quicker?)

根据Kudu函数调用日志,此案例报告未完成",当我单击切换输出"按钮以查看日志时,它们永远不会进入.

According to the Kudu Function Invocation Logs, this case reports "Never Finished", and when I click on the Toggle Output button to view the logs, they never come in.

当我查看该函数在该触发器的日志"部分中运行时,似乎该函数刚刚停止,并且日志流仅报告没有新的跟踪记录:

When I viewed this function's run in the Logs section of that trigger, it seems like the function just stopped, and the log stream just reports no new trace:

2017-07-26T16:36:43.116 [INFO] [Class1] Update operation started processing 790 sales records ... 2017-07-26T16:36:43.116 [DBUG] [Class2] Matching and updating ids from the map... 2017-07-26T16:38:07 No new trace in the past 1 min(s). 2017-07-26T16:39:07 No new trace in the past 2 min(s). 2017-07-26T16:40:07 No new trace in the past 3 min(s). 2017-07-26T16:41:07 No new trace in the past 4 min(s).

2017-07-26T16:36:43.116 [INFO] [Class1] Update operation started processing 790 sales records ... 2017-07-26T16:36:43.116 [DBUG] [Class2] Matching and updating ids from the map... 2017-07-26T16:38:07 No new trace in the past 1 min(s). 2017-07-26T16:39:07 No new trace in the past 2 min(s). 2017-07-26T16:40:07 No new trace in the past 3 min(s). 2017-07-26T16:41:07 No new trace in the past 4 min(s).

因此不确定该功能为何似乎停止了-或它停止了收集日志语句(有很多),并且由于某种原因,该功能从未完成.

So not sure why this function just seemed to stop - or perhaps it stopped collecting log statements (there are many), and for some reason, the function never completed.

有什么想法吗?

大约时间::2017-07-26T16:00:00 UTC InvocationID::d856c107-f1ee-455a-892b-ed970dcad128(我认为?)

Approx time: 2017-07-26T16:00:00 UTC InvocationID: d856c107-f1ee-455a-892b-ed970dcad128 (I think?)

如果确实超时,我们有什么办法可以知道((异常?App Insights?等)

If it is indeed being timed out, is there any way for us to know, (Exception? App Insights? etc.)

推荐答案

如果您的HTTP方法耗时超过一分钟,则应将其卸载到队列中.时期. (我知道其他答案已经说过了,但是值得重复).

If your HTTP method takes more than a minute, you should be offloading it to a Queue. Period. (I know the other answers have said this, but it's worth repeating).

  • Http连接是有限的资源.
  • 虽然Azure函数作为执行引擎可以处理长时间运行 操作(如队列/服务总线支持所示), http管道可能会中断/超时长时间运行的请求.
  • Http connections are a limited resource.
  • While Azure Functions as an execution engine can handle long running operations (as demonstrated by queue / service bus support), the http pipeline may cut off / timeout long running requests.
  • 队列触发器可以轻松运行30分钟以上.如果您的工作时间长于此,则应该将其拆分为多个队列消息.

    Queue triggers can easily run for 30+ minutes. If your job is longer than that, you really should split it into multiple queue messages.

    也请查看耐用功能支持: github/Azure/azure-functions-durable-extension/

    Also check out Durable Function support: github/Azure/azure-functions-durable-extension/

    更多推荐

    永远在线应用程序服务计划上的Azure功能超时,但未设置功能超时设置

    本文发布于:2023-11-28 07:51:12,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1641545.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:在线   功能   应用程序   但未   计划

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!