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

查看:67
本文介绍了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函数会限制webhook调用吗?也就是说,如果我的函数应用处于高负载状态,Azure函数会拒绝某些函数调用吗?
  2. Azure函数是否以某种方式将请求排队?如果是这样,在哪里/如何?
  3. 在这种情况下,Azure Functions将创建我的Function应用程序的多少个实例?每个请求一个(即10,000个),每个都会并行运行?
  4. 如果我的应用程序功能被缩小为零个实例,因为没有负载,我可以期望在执行第一个功能之前看到一些预热时间"吗?大概多长时间?

推荐答案

  1. Azure函数不会拒绝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天全站免登陆