每个函数还是全局的Azure Functions host.json设置? [英] Azure Functions host.json settings per function or global?

查看:46
本文介绍了每个函数还是全局的Azure Functions host.json设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

host.json中的设置是分别应用于每个功能还是整体应用于所有功能?

Do the settings in host.json apply to each function individually, or apply to all of the functions as a whole?

例如,我在同一个项目中有两个函数都从Azure ServiceBus队列获取消息.

For example, I've two functions in the same Project that both get messages from Azure ServiceBus Queues.

如果我在host.json中将maxConcurrentCalls设置为10,这是否意味着整体上将仅对ServiceBus进行10个并发调用,或者每个函数10个 ,因此会有20个并发呼叫?

If I set maxConcurrentCalls to 10 in host.json, does that mean that as a whole only 10 concurrent calls to ServiceBus will be made, or that it is 10 per function, so there will be 20 concurrent calls?

谢谢.

推荐答案

host.json 文件被FunctionApp的所有功能共享.也就是说, maxConcurrentCalls 值将应用于该应用程序的所有功能,就像其他任何设置一样.

host.json file is shared for all functions of a FunctionApp. That's to say that maxConcurrentCalls value will apply to all functions of the app, as any other setting will.

maxConcurrentCalls 的效果对于每个函数都是独立的.在您的示例中,每个功能最多可同时处理10条消息.如果将其设置为1,则每个函数将有1个线程在工作.

The effect of maxConcurrentCalls will be independent for each function. In your example, each function will have up to 10 messages processed concurrently. If you set it to 1, there will be 1 thread working per function.

请注意, maxConcurrentCalls 适用于每个实例.如果您有多个实例在运行,则最大并发比例会成比例增加.

Note that maxConcurrentCalls applies per instance. If you have multiple instances running, the max concurrency increases proportionally.

这篇关于每个函数还是全局的Azure Functions host.json设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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