【问题标题】:Why do i get a timeout when using Azure logic apps?为什么在使用 Azure 逻辑应用时会出现超时?
【发布时间】:2016-10-11 02:29:59
【问题描述】:

我正在使用 Azure 逻辑应用的最新预览版,我的一个主题检查消息标题中的字符串是否与 SOME_STRING 匹配,如下面的代码所示

    "authenticatedresponse": {
        "conditions": [
            { 
                "expression": "@equals(coalesce(trigger().outputs?.headers?['CHECK_THIS_STRING'], ''),  'SOME_STRING')"
            }
        ],
        "inputs": {
            "statusCode": 202
        },
        "type": "Response"
    }

主题应该检查条件是否为真,然后将消息传递到服务总线。它适用于 99% 的情况,但有时我会收到超时异常消息 {"code":"ActionResponseTimedOut","message":"The execution of template action 'authenticatedresponse' is failed: the client application timed out waiting for a response from service. This means that workflow took longer to respond than the alloted timeout value. The connection maintained between the client application and service will be closed and client application will get an HTTP status code 504 Gateway Timeout."}

正如您所见,这是一个非常简单的条件,因此执行起来并不需要太多时间。有人知道问题可能是什么吗?

【问题讨论】:

    标签: azure azure-logic-apps


    【解决方案1】:

    响应操作超时基于逻辑应用运行的整体执行持续时间,而不仅仅是响应操作本身的执行持续时间。

    因此,如果逻辑应用运行的完成时间超过 90 秒(到达响应操作),则客户端连接将关闭(假设客户端仍在等待 http 响应)并且响应操作失败。

    【讨论】:

    • 好的,但我得到超时仍然很奇怪,对吧?我没有回复消息,只是将其传递给 Azure 服务总线。我该怎么做才需要 90 秒才能完成?
    【解决方案2】:

    这可能有多种原因。常见的有:

    1. 响应操作之前的操作需要 90 多秒才能完成
    2. 由于超出了应用在 5 分钟内可能完成的操作数限制(例如,在高负载下大量同时运行您的应用),逻辑应用受到限制

    对于 (1),降低应用程序的复杂性,在响应步骤之后移动对时间敏感的操作,或将应用程序拆分为多个部分。

    对于 (2),current default limit 是 10 万个操作,可以在给定的 5 分钟内完成,之后您的应用程序将被限制。您可以通过访问 Azure 门户的 Metrics 部分,选择您的应用程序,然后添加“Action Throttled Events”(或“Trigger Throttled Events”)来验证这种情况是否发生。如果这是问题所在,您可以将应用程序配置为 "High Throughput Mode"(当前处于预览状态)以将限制增加到 300k。 Microsoft 的说明不适用于我通过 ARM 模板启用,但此代码可以:

      "properties": {
        "state": "Enabled",
        "runtimeConfiguration": {
          "operationOptions": "OptimizedForHighThroughput"
        },...
    

    【讨论】:

      猜你喜欢
      • 2018-05-10
      • 2020-08-29
      • 1970-01-01
      • 2018-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-30
      • 2017-07-05
      相关资源
      最近更新 更多