TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: If kafka topic has X number partition then should I deploy X consumer?

2 点作者 asomethings大约 4 年前
Few documents say that consumer must equal to consumer count or unless it will slow down. I understand why it slows down. So I did some simple math.<p>IF Kafka Throughput is 100K&#x2F;s and takes 100ms to process it. It will need 10,000 partitions according to https:&#x2F;&#x2F;eventsizer.io&#x2F;partitions .<p>Then should I deploy 10K consumers to process it without lag or latency? I think real-time chat app like `Discord` or `Slack` should have more throughput then 100K&#x2F;s but I don&#x27;t think they have 10K consumers up and running.<p>What am I missing here?

1 comment

z9e大约 4 年前
In theory yes, you want a 1:1 partition to consumer ratio, that would give you the most optimal throughput, but it’s okay if you have less consumers than partitions, you’ll just have consumers doing more work.<p>Keep in mind you shouldn’t really go over 20k partitions in a Kafka cluster (recommended by Confluent), as that’s when things will start to get unstable. 10k is a lot of partitions, we have a hundred topics in our main cluster and only are at 15k partitions total. But if your running a high scale low latency environment then that sounds like what you’d need.