concurrency - Azure Functions 并发和缩放行为

标签 concurrency azure-functions serverless azure-http-trigger

SO 上有一堆 Azure Functions 并发问题,但没有一个专门解决这个问题。

我正在全神贯注于 HTTP 触发的函数应用程序的缩放场景(如果重要的话,运行时是 Node.js)。我来自 AWS Lambda 世界,每个并发调用 results在一个新的 Lambda 实例中:

If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency.

让我对 Azure Function 应用程序感到困惑的是这篇文章来自他们的 documentation :

A single function app only scales out to a maximum of 200 instances. A single instance may process more than one message or request at a time though, so there isn't a set limit on number of concurrent executions.

在什么情况下单个 FA 实例会同时处理多个请求?

最佳答案

这一行大概指的是下面information :

The host.json file in the function app allows for configuration of host runtime and trigger behaviors. In addition to batching behaviors, you can manage concurrency for a number of triggers. Often adjusting the values in these options can help each instance scale appropriately for the demands of the invoked functions.

Settings in the host.json file apply across all functions within the app, within a single instance of the function. For example, if you had a function app with two HTTP functions and maxConcurrentRequests requests set to 25, a request to either HTTP trigger would count towards the shared 25 concurrent requests. When that function app is scaled to 10 instances, the two functions effectively allow 250 concurrent requests (10 instances * 25 concurrent requests per instance).

Other host configuration options are found in the host.json configuration article.

关于concurrency - Azure Functions 并发和缩放行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64564956/

相关文章:

java - 这种并发模式有名称吗?

java - 缺少带锁和 ConcurrentHashMap 的更新

c# - 从 azure 函数运行 azure 存储过程

azure - 将 Azure AppServices 中的 Web API 的访问限制为 Azure Function 应用程序,同时允许其他服务访问其他 Web api 和网页

amazon-web-services - AWS Lambda 是否适合实时 API Rest?

python - io/cpu 绑定(bind)任务的 Celery 并发配置

c++ - 在并行循环中添加 double - std::atomic<double>

Azure函数: Can't check memory usage of instances

amazon-web-services - 无服务器:验证错误...成员必须满足正则表达式模式:表名

node.js - 在 Vercel 上部署的 Nextjs 中的 api 请求上出现 504/502 错误