azure-functions - Azure 函数忽略 MaxConcurrentRequests 设置
问题描述
我有一个使用此 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 时,如果这个设置值得到尊重,并且我已经正确理解了它。
解决方案
我相信这是已知问题。https://github.com/Azure/azure-functions-host/issues/6548
核心团队已经解决了这个问题,他们预计在 12 月底发布。
推荐阅读
- c# - 在 PartialView 中仅查看数据库中包含“Foo”的行
- javascript - 如何解决自定义抽屉组件可触摸 onPress 屏幕切换在 React-Native 中不起作用?
- maven - 类路径上的 UIComponent 两次,应该从哪里导入?
- php - 照亮\广播\广播异常没有消息
- c++ - 为什么某些 STL 函数(例如“find”)不需要“std::”(有时)?
- c# - 带有左连接子查询的 SQL 到 LINQ
- python - 尝试使用 jupyter notebook 中下拉菜单中的值绘制图形
- python - 计算 pandas 数据框中包含 n 个值的行数
- python - Selenium 的 driver.get() 调用的最大递归错误
- angular - 如何在 Angular 7 中使用 chart.js