功能较少的多功能应用程序或功能较多的功能应用程序少? [英] Multiple Function Apps with fewer Functions or few Function Apps with lots of Functions?

查看:28
本文介绍了功能较少的多功能应用程序或功能较多的功能应用程序少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前在 Azure 中为每个环境/每个区域部署一个 Function App.这些功能应用程序内部包含许多功能.将服务计划设置为消耗并因此是动态的,我们对此非常满意,因为它降低了 ARM 模板中的操作复杂性.

We are currently deploying a single Function App per environment / per region in Azure. These Function Apps contain lots of Functions inside them. With the Service Plan set to consumption and therefore dynamic we are fairly happy with this as it reduces the operational complexity in our ARM templates.

但我们确实想知道,是否最好在每个环境中拥有更多功能应用程序"并将我们的功能分布在它们之间?

We do wonder though, if it would be best to have more "function apps" per environment and spread our functions across them?

这样做有什么真正的好处吗?因为我们认为动态服务计划会影响性能?

Is there any real benefit to doing this as we are under the impression performance will be scaled by the dynamic service plan?

推荐答案

乔丹,

问题的答案实际上取决于您使用函数处理的工作负载类型.

The answer to the question would really depend on the type of workloads you're handling with your functions.

虽然缩放控制器会处理缩放以满足需求,但函数应用中的函数确实会在每个实例上共享资源,并且资源密集型(内存或 CPU)可能会影响同一应用中的其他函数.

Although the scale controller will handle scaling to meet demand, functions within a Function App do share resources on each instance, and a resource intensive (either memory or CPU) may impact other functions in the same app.

同一个Function App中的函数之间也没有进程隔离.它们都在同一个进程中运行(除了一些脚本语言,如 Python、Batch 等)和同一个 App Domain 中.因此,如果隔离是一个因素(出于安全、依赖管理、共享状态等原因),您可能需要考虑将功能拆分到不同的应用程序中.

There is also no process isolation between functions in the same Function App. They all run in the same process (except for some of the scripting languages like Python, Batch, etc) and in the same App Domain. So if isolation is a factor (for reasons like security, dependency management, shared state, ect.), you may want to consider splitting functions into different apps.

版本控制和部署是另一个值得考虑的因素,因为部署单元是一个函数应用程序(而不是单个函数)

Versioning and deployment is another factor worth considering, as the unit of deployment is a Function App (and not the individual functions)

话虽如此,如果您的工作负载没有遇到资源消耗问题并且上述问题不是问题,正如您所指出的,在单个函数应用程序中运行多个函数可以显着简化管理,所以我不会如果没有必要,不要改变这种方法.

With that said, if you're not running into resource consumption issues with your workloads and the issues mentioned above are not a concern, as you pointed out, running multiple functions in a single function app significantly simplifies management, so I wouldn't change that approach if there's no need to do so.

我希望这会有所帮助!

这篇关于功能较少的多功能应用程序或功能较多的功能应用程序少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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