超出主机阈值:[连接数] [英] Host thresholds exceeded: [Connections]

查看:161
本文介绍了超出主机阈值:[连接数]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们遇到错误超出主机阈值:[连接]".运行一段时间后,使用我们的某些功能(V1).我们正在对功能使用消费计划"以实现可扩展性.我们有4个eventhub接收者正在收听eventhub 有32个分区.其中有两个侦听器只是批量接收事件并将其中继到另一个eventhub,而其他两个侦听器正在使用Table API将数据提取到Cosmos DB.

We're experiencing the error "Host thresholds exceeded: [Connections]" with some of our functions (V1) after running for a while. We're using Consumption Plan for our functions for scalability. We have 4 eventhub receivers listening to an eventhub with 32 partitions. 2 of the listeners are just receiving the events in batch and relaying it to another eventhub, while the 2 others are ingesting data to Cosmos DB using the Table API.

我们是否需要重构并为每个接收器提供一个功能,或者我们可以在host.json中进行任何设置以避免在达到连接阈值之前发生此错误以使其扩展?尚不清楚host.json中的哪些设置会影响 eventhub的接收者和发送者,但我们一直在使用以下设置:

Do we need to refactor and have one function for each receiver, or is there any settings we can put in host.json to avoid getting this error to make it scale out before hitting the connection threshold? It's a bit unclear which settings in host.json influences eventhub receivers and senders, but we've been using these settings:

所有接收器都是异步的,但是所有方法都在等待中:

 公共静态异步任务RunAsync([EventHubTrigger("events",Connection =< EventsConnection>,ConsumerGroup = ReceiverConsumerGroup)]] EventData [] eventDataSet,[EventHub("actionevent"",Connection =< EventHubActionSenderConnection>]] IAsyncCollector< EventData>输出,TraceWriter日志)

All of the receivers are async, but all methods are awaited:

 public static async Task RunAsync([EventHubTrigger("events", Connection = <EventsConnection>, ConsumerGroup = ReceiverConsumerGroup)]EventData[] eventDataSet, [EventHub("actionevent", Connection = <EventHubActionSenderConnection>)] IAsyncCollector<EventData> output,TraceWriter log)

{

.....

     等待输出.AddAsync(obj); 

     await output.AddAsync(obj); 

}

推荐答案

Hello Jflux,

此错误对应于消费计划的连接阈值限制,并且不能由host.json文件控制

每个函数实例都意味着一个新的连接,这些实例所建立的所有连接都计入函数应用程序沙箱的限制.这包括由函数应用程序中的每个实例和每个函数建立的连接.

您可以参考 有关沙箱限制的文章.

最好的选择是将功能拆分为单独的功能应用程序,以使每个功能应用程序都在自己的沙箱限制内运行.
Hello Jflux,

This error corresponds to the connection threshold limit of the Consumption Plan and could not be controlled by host.json file

Every function instance implies to a new connection and all the connections made by these instances count towards the sandbox's limit of your function app. This includes connections made by every instance and every function in your function app.

You can refer to this article on the limits for a sandbox.

The best option here would be just split functions into separate function apps so that each function app runs in its own sandbox limits.


这篇关于超出主机阈值:[连接数]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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