[英]Does one consumer thread against many partitions per topic in Kafka can cause latency?
Our kafka setup is as follows: 我们的kafka设置如下:
we configured this way to be able to scale-up in the future. 我们将这种方式配置为能够在将来扩大规模。
we wanted to minimize the times we re-balance when we need to scale-up by adding partitions because latency is very important to us and during re-balances messages can be stuck till the coordination phase is done 我们希望通过添加分区来最大程度地减少重新平衡的时间,因为延迟对我们非常重要,并且在重新平衡过程中,消息可能会停留在协调阶段完成之前
Having 1 consumer thread with many partitions per 1 topic can effect somehow the overall messaging consuming latency? 在每个1个主题中拥有1个使用方线程并具有多个分区可以以某种方式影响整体消息传递消耗延迟吗?
More partitions in a Kafka cluster leads to higher throughput however, you need to be aware that the number of partitions has an impact on availability and latency as well. Kafka群集中的更多分区会导致更高的吞吐量,但是,您需要注意分区的数量也会影响可用性和延迟。
In general more partitions, 一般来说,更多分区
You need to study the trade-offs and make sure that you've picked the number of partitions that satisfies your requirements regarding throughput, latency and required resources. 您需要研究折衷方案,并确保已选择满足吞吐量,延迟和所需资源要求的分区数量。
For further details refer to this blog post from Confluent. 有关更多详细信息,请参阅Confluent的此博客文章。
My opinion: Make some tests and write down your findings. 我的意见:做一些测试并写下您的发现。 For example, try to run a single consumer over a topic with 5, 10, 15, ... partitions, measure the impact and pick the configuration that meets your requirements. 例如,尝试在具有5、10、15,...个分区的主题上运行单个使用者,衡量影响并选择满足您要求的配置。 Finally ask yourself if you will ever need x
partitions. 最后问问自己是否需要x
分区。 At the end of the day, if you need more partitions you should not worry about re-balancing etc. Kafka was designed to be scalable . 归根结底,如果您需要更多的分区,则不必担心重新平衡等问题。Kafka设计为可伸缩的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.