简体   繁体   English

Kafka 中每个事务的消息数

[英]Number of Messages Per Transaction in Kafka

Are there guidelines on how many messages and/or partitions can be involved in a Kafka Producer Transaction before performance really starts to suffer?在性能真正开始受到影响之前,是否有关于 Kafka 生产者事务中可以涉及多少消息和/或分区的指南?

Obviously, the more partitions are involved, the more coordination is required.显然,涉及的分区越多,就越需要协调。 But in Kafka Streams, for example, the default commit interval is 100ms.但在 Kafka Streams 中,例如,默认的提交间隔是 100 毫秒。 In that time, normally hundreds of messages can be processed by a Stream thread.在那个时候,通常一个 Stream 线程可以处理数百条消息。 And depending on the topology, that may involve many different output topics (and by extension, partitions).并且根据拓扑,这可能涉及许多不同的输出主题(以及扩展,分区)。 Does that mean that it's safe to push transactions with hundreds of messages and dozens of partitions?这是否意味着推送包含数百条消息和数十个分区的事务是安全的?

I can't find anything about this in the documentation.我在文档中找不到任何关于此的内容。

https://www.confluent.io/blog/transactions-apache-kafka/ I found this in Confluent's blog. https://www.confluent.io/blog/transactions-apache-kafka/我在 Confluent 的博客中找到了这个。 Turns out that the overhead doesn't increase per message per transactin;事实证明,每个事务的每条消息的开销不会增加; rather, you actually increase throughput if you have more messages per transaction.相反,如果每个事务有更多消息,您实际上会增加吞吐量。

In fact, the average overhead per message decreases as you add more messages to the transaction.事实上,每条消息的平均开销随着您向事务中添加更多消息而减少。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM