Azure Functions 如何横向扩展? [英] How do Azure Functions scale out?

查看:24
本文介绍了Azure Functions 如何横向扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Azure Functions 的缩放文档对如何进行Azure Functions 决定何时添加更多应用实例.

The scaling documentation for Azure Functions is a bit light on details for how Azure Functions decide when to add more instances of an app.

例如,我有一个由 Github webhook 触发的函数.10,000 人同时提交到 Github 存储库(没有合并冲突;)),Github 在很短的时间内调用了我的函数 10,000 次.

Say for example I have a function that is triggered by a Github webhook. 10,000 people simultaneously commit to the Github repo (with no merge conflicts ;) ), and Github calls my function 10,000 times in a very short period of time.

我可以期待会发生什么?具体来说,

What can I expect to happen? Specifically,

  1. Azure Functions 会限制 webhook 调用吗?即,如果我的函数应用处于高负载状态,Azure Functions 会拒绝某些函数调用吗?
  2. Azure Functions 是否以某种方式对请求进行排队?如果是,在哪里/如何?
  3. 在这种情况下,Azure Functions 将创建多少个我的函数应用实例?每个请求一个(即 10,000 个),每个请求将并行运行?
  4. 如果我的应用函数因为没有负载而被缩减到零个实例,我是否可以期望在第一个函数执行之前看到一些预热时间"?大概多长时间?

推荐答案

  1. Azure Functions 不会拒绝 webhook 调用,但在突然、极端负载的情况下,某些请求可能会超时.对于 Web api,作为最佳做法,请在客户端上重试.
  2. 它们不会在任何固定位置排队.它们由 IIS 管理(实施细节).
  3. (实现细节)实例的数量并不是一个很难确定的事情.我们有一定的、未发布的保护措施,但我们的设计目的是扩大规模.您的请求将由多个实例处理.
  4. 是的.现在,它相当大(秒),但我们会努力改进它.对于性能敏感的情况,建议使用金丝雀或计时器触发器以使其保持清醒.

我来自 Azure Functions 团队.我标记为实现细节的东西不是承诺,并且可能会随着我们服务的发展而改变;只是为了透明.

I'm from the Azure Functions team. The things I marked as implementation details aren't promises and will likely also change as we evolve our service; just an attempt at transparency.

这篇关于Azure Functions 如何横向扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆