且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

事件中心是否应具有与吞吐量单位相同的分区数?

更新时间:2023-02-27 14:18:46

伟大的Qstn!

1个ThruPut单元(这里我称为TU)-表示1 MB/秒或1000msgs/秒-以先发生的为准. 您为TU付费=>您可以根据负载要求更改TU .这是您对条例草案的了解. 并且在给定的事件中心命名空间上设置了TU!

1 ThruPut Unit (hereby, I will call TU) - means 1 MB/Sec or 1000msgs/sec - whichever happens first. You pay for TU's => you can change TUs as per your load requirements. This is your knob on the Bill. And TU is set on a given Event Hubs Namespace!

因此,当您为其中包含10个EventHub的EventHubs命名空间购买1 TU时,这意味着所有这10个EventHub的累计使用量可以为1TU.

So, when you buy 1 TU for an EventHubs Namespace with 10 EventHubs in it, it means that, cumulative usage of all of these 10 EventHubs can be 1TU.

每个分区分别以1 MB/秒或1000 msgs/秒的速度进行CAP(最大容量)分区(以先发生者为准).尽管有时在某些负载较少的地区可能会很幸运-这是Azure EventHubs服务提供的唯一保证.在决定否时要考虑这些原则.为您的服务在eventhub中划分的分区:

Individually, each Partition is CAP'ed (aka MAX'ed out) by 1 MB/Sec or 1000 msgs/sec ingress - whichever happens first. Although, sometimes you might get lucky in some regions where load is less - this is the only Guarantee offered by Azure EventHubs service. Consider these principles while deciding on no. of partitions in eventhub for your service:

  1. 我们提供分区的目的之一是提供高可用性.如果您要发送到eventhub,并且希望发送成功,则服务上没有发生任何事情-您应该创建多个分区,并使用 EventHubClient.Send (不会将发送粘贴到分区).
  2. 还有其他主要因素:否.分区-将确定胖事件管道的方式&您如何快速/并行地接收&处理事件.如果您的EventHub上有10个分区,则其容量最大为10 TU.您可以并行创建10个时期接收器.消耗和处理事件.如果您设想当前正在创建的EventHub-可以快速增长10倍-请创建尽可能多的分区,并保持TU与当前负载匹配.打个比方就像-在高速公路上有多个车道!
  1. One of Our intents to provide Partitions - is to offer high-availability. If you are sending to eventhubs and want the sends to succeed, NO MATTER WHAT HAPPENS on service - you should create multiple partitions and send using EventHubClient.Send (which doesn't stick the send to a partition).
  2. And, also other major factor: No. of partitions - will determine how fat the Event Pipe is & how fast/parallel you can receive & process the events. If you have 10 partitions on your EventHub - it's capacity is MAX'ed to 10 TUs. You can create 10 epoch receivers in parallel & consume & process events. If you envision that the EventHub that you are currently creating now - can quickly grow 10-fold - create as many partitions and keep the TU's matching the current load. Analogy here is like - having multiple lanes on a Freeway!

需要记住的最重要的一点是, TU是在名称空间级别配置的.而且,一个事件中心名称空间可以具有多个事件中心.每个eventhub可以有不同的编号.分区.

One more, most important point to remember is, TU is configured at namespace level. And, ONE Event Hubs namespace can have multiple eventhubs. Each eventhub can have different no. of partitions.

答案 :

Answers:

如果您在命名空间上选择5个或更多TU,并且只有1个带有4个分区的EventHub-您将获得一个最大值.每秒4 MBPS或4K msgs/秒.

if you select 5 or more TUs on the Namespace and have only 1 EventHub with 4 partitions - you will get a max. of 4 MBPS or 4K msgs/sec.

最大出口将是Ingress的2倍(8 MBPS或8K msgs/sec).换句话说,您可以通过创建

Egress max. will be 2X of Ingress (8 MBPS or 8K msgs/sec). In otherwords, you could create 2 patterns of receives (slow and fast etc) by creating consumergroups - depicting your receive pattern. If you need more than 2X parallel receives - then you will need to by more TUs.

是的,每个EventHubs分区限制为1 TU(1 MBPS或1K Msgs/sec).

Yes, each EventHubs Partition limit is 1 TU (1 MBPS or 1K Msgs/sec).

是的.理想情况下,您将需要比TU多的分区.首先,如上所述对分区计数进行建模.在开发解决方案时,请从1 TU开始.完成后,当您进行负载测试或上线时,请增加TU以调整到您的负载.请记住,命名空间中可能有多个eventhub.因此,拥有20个TU的命名空间级别和10个带有四个分区的eventhub-可以在整个命名空间中提供20 MBPS.

Yes. Ideally, you will need more partitions than TUs. First, model your partition count as mentioned above. Start with 1 TU while you are developing your Solution. Once done, when you are doing load testing or going live, increase TUs to tune to your load. Remember, you could have multiple eventhubs in a Namespace. So, having 20 TUs at Namespace level and 10 eventhubs with 4 partitions each - can deliver 20 MBPS across the Namespace.

有关事件中心的更多信息...