Open
Conversation
Set fetch.min.bytes to 64 KiB and fetch.max.wait.ms to 500 ms for Kafka consumers. Previously, consumers used the default configuration (fetch.min.bytes=1), which causes the broker to return data as soon as any message is available. In low-throughput scenarios, this leads to very frequent fetch requests with small payloads, increasing CPU usage on the brokers. With this change: The broker will wait until at least 64 KiB of data is available before responding, or up to 500 ms if the threshold is not reached. This reduces the number of fetch requests and improves batching efficiency. CPU overhead on Kafka brokers is expected to decrease due to fewer, larger responses. Impact: In low-traffic topics: slightly increased latency (up to ~500 ms) but significantly fewer fetch requests. In high-throughput periods (e.g. full dumps): no meaningful delay, as the threshold is reached quickly and batching improves throughput. This is a trade-off favoring throughput and resource efficiency over minimal latency, which is acceptable for our use cases.
Adding integration test, which verifies that "idle-between-polls" actually is in effect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set fetch.min.bytes to 64 KiB and fetch.max.wait.ms to 500 ms for Kafka consumers.
Previously, consumers used the default configuration (fetch.min.bytes=1), which causes the broker to return data as soon as any message is available. In low-throughput scenarios, this leads to very frequent fetch requests with small payloads, increasing CPU usage on the brokers.
With this change:
Impact:
This is a trade-off favoring throughput and resource efficiency over minimal latency, which is acceptable for our use cases.