【问题标题】:Azure Function ignoring MaxConcurrentRequests settingAzure 函数忽略 MaxConcurrentRequests 设置
【发布时间】:2020-12-02 14:35:33
【问题描述】:

我有一个使用此 host.json 配置运行的 Azure 函数:

 {
  "version": "2.0",
  "extensions": {
    "http": {
      "routePrefix": "api",
      "maxOutstandingRequests": 200,
      "maxConcurrentRequests": 2,
      "dynamicThrottlesEnabled": false
    }
  }
}

但是,当这个函数应用运行时,我可以看到有超过 2 个请求同时运行:

    private static int concurrency;

    [FunctionName(nameof(Page))]
    private async Task<IActionResult> Page(string arg)
    {
        var n = Interlocked.Increment(ref concurrency);
        try
        {
            this.log.Debug(n);

            // The code
        }
        finally
        {
            Interlocked.Decrement(ref n);
        }
    }

当我提高对函数的调用率时,我会记录 n 值超过 20 的日志条目,而我希望永远不会看到超过 2 的值,如果此设置值得到遵守,并且我已经理解它是正确的。

【问题讨论】:

    标签: azure-functions azure-function-app azure-functions-runtime


    【解决方案1】:

    我相信这是已知问题。 https://github.com/Azure/azure-functions-host/issues/6548

    核心团队已经解决了这个问题,他们预计会在 12 月底发布。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-05
      • 1970-01-01
      相关资源
      最近更新 更多