Quick revision
The short answer
The broker answers a fetch as soon as it has at least fetch.min.bytes of data (1 byte by default) or once fetch.max.wait.ms has passed (500 ms by default), whichever comes first. How much comes back is limited per partition by max.partition.fetch.bytes (1 MB) and for the whole response by fetch.max.bytes (50 MB), except that a single record batch larger than those is still returned so the consumer can make progress. max.poll.records (500) is different: it only limits how many already-buffered records one poll() hands to our code and has no effect on fetch sizes.
What to remember
In this answer, we separated the consumer into two layers. Fetch requests go to each leader broker, and the broker answers once it has fetch.min.bytes (1 byte) or after fetch.max.wait.ms (500 ms). Responses are capped at max.partition.fetch.bytes (1 MB) per partition and fetch.max.bytes (50 MB) overall, with a single oversized batch still returned so the consumer can progress, and incremental fetch sessions keep repeated requests small. max.poll.records (500) only limits how many buffered records poll() returns. Raising fetch.min.bytes trades latency for efficiency, so latency-sensitive consumers keep the default.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
The broker answers a fetch as soon as it has at least fetch.min.bytes of data (1 byte by default) or once fetch.max.wait.ms has passed (500 ms by default), whichever comes first. How much comes back is limited per partition by max.partition.fetch.bytes (1 MB) and for the whole response by fetch.max.bytes (50 MB), except that a single record batch larger than those is still returned so the consumer can make progress. max.poll.records (500) is different: it only limits how many already-buffered records one poll() hands to our code and has no effect on fetch sizes.
Why this question is asked
These five settings decide a consumer's latency, throughput and memory, and they are easy to confuse because the names sound alike. Interviewers ask about them to check whether we know which side of the consumer each one acts on: the network fetch or the hand-off to our code. In this answer, we will recap how a consumer gets data, then look at when the broker answers, how much it sends, how the consumer keeps fetches going in the background, what max.poll.records really does, and how to tune for latency or throughput.
1A Quick Recap: Fetching Is Not Polling
Our code calls poll() and receives records, so it is tempting to think poll() asks the broker for those records. In fact, the consumer has two layers. Underneath, it sends fetch requests to the brokers that lead its partitions and stores the responses in an internal buffer. On top, poll() takes records out of that buffer and returns them to us. Some settings control the first layer, one controls the second.
- Our code calls poll()receives at most
max.poll.recordsrecords - Fetch buffer in the consumerholds completed fetch responses, per partition
- Fetch requests, one per leader brokersized by
max.partition.fetch.bytesandfetch.max.bytes - Brokeranswers at
fetch.min.bytesor afterfetch.max.wait.ms
4 layers, from the top down. Step through them one at a time.
2When the Broker Answers: fetch.min.bytes and fetch.max.wait.ms
A fetch request is a kind of long poll. The broker holds it until it has enough new data to be worth sending, then answers. 'Enough' is fetch.min.bytes, 1 byte by default, which means 'answer as soon as there is anything'. To avoid holding a request forever on a quiet topic, the broker also answers after fetch.max.wait.ms, 500 ms by default, even with less data, possibly with none.
So with the defaults, a consumer on a busy topic gets responses immediately, and on an idle topic it gets an empty response every half second. If we raise fetch.min.bytes to 64 KB, the broker waits until 64 KB have accumulated across the partitions in the request, or 500 ms have passed. That trades latency for fewer, bigger responses.
3How Much Comes Back: max.partition.fetch.bytes and fetch.max.bytes
Two limits cap the size of a response. max.partition.fetch.bytes, 1 MB by default, limits the data returned for any one partition. fetch.max.bytes, 50 MB by default, limits the whole response across partitions. A consumer reading 20 partitions from one broker could in principle receive 20 MB in one response, still under the 50 MB cap.
There is one deliberate exception. If the first record batch in a partition is larger than these limits, for example a 3 MB batch with a 1 MB per-partition limit, the broker still returns that one batch. Otherwise the consumer could never get past it and would be stuck forever. So these limits are soft for single batches; the real hard limit on record size is the broker's and topic's message size settings.
4How the Consumer Keeps Fetches Going
The consumer sends at most one fetch request at a time to each broker that leads some of its partitions, including in it the partitions that have no data waiting in the buffer. When a response arrives, the data goes into the buffer, and the next fetch to that broker can go out. Because this happens during poll() calls and in the background, data for the next poll is often already waiting when our code asks for it.
Repeated fetches are kept small by incremental fetch sessions. The first request in a session lists all the partitions and their positions; later requests list only what changed, and the broker's response omits partitions with nothing new. With hundreds of partitions, this saves a lot of bytes and broker CPU on every round trip.
5Max.poll.records Is About Our Code, Not the Network
max.poll.records, 500 by default, caps how many records one poll() returns from the buffer. If a fetch brought back 3,000 records, our code receives them across six polls, and no network request happens in between. Lowering max.poll.records does not make fetches smaller; it makes each loop of our code shorter, which is how we keep processing time under max.poll.interval.ms.
That separation is the most common interview trap: raising max.poll.records does not increase fetch throughput, and lowering it does not save network traffic.
| Setting | Default | Acts on | Effect |
|---|---|---|---|
fetch.min.bytes | 1 byte | broker response timing | bigger means fewer, larger responses |
fetch.max.wait.ms | 500 ms | broker response timing | upper bound on the added latency |
max.partition.fetch.bytes | 1 MB | response size per partition | soft: one larger batch still returned |
fetch.max.bytes | 50 MB | whole response size | soft in the same way |
max.poll.records | 500 | hand-off to our code | no effect on fetching |
6Tuning for Latency or for Throughput
For a latency-sensitive consumer, such as one reacting to user actions, the defaults are usually right: the broker answers as soon as data exists. Raising fetch.min.bytes would add up to fetch.max.wait.ms of delay whenever traffic is light.
For a throughput consumer, such as a loader writing to a data lake, raising fetch.min.bytes to, say, 256 KB or 1 MB, with fetch.max.wait.ms around 500 ms, means fewer requests, better compression ratios per response and less broker CPU per byte. A larger max.partition.fetch.bytes can help when there are few partitions per broker, but it also raises memory use, because the buffer can hold up to that much per partition.
7Follow-up questions
Why does my consumer get empty polls every 500 ms on a quiet topic?
Because fetch.max.wait.ms bounds how long the broker holds a fetch, so on a topic with no new data it answers with nothing every 500 ms. That is normal and cheap. poll() itself may return earlier or later depending on the timeout we pass it.
Does fetch.min.bytes apply per partition?
No, it applies to the whole response the broker is preparing for that fetch request, across all the partitions in it. One busy partition can satisfy it on its own.
8Conclusion
In this answer, we separated the consumer into two layers. Fetch requests go to each leader broker, and the broker answers once it has fetch.min.bytes (1 byte) or after fetch.max.wait.ms (500 ms). Responses are capped at max.partition.fetch.bytes (1 MB) per partition and fetch.max.bytes (50 MB) overall, with a single oversized batch still returned so the consumer can progress, and incremental fetch sessions keep repeated requests small. max.poll.records (500) only limits how many buffered records poll() returns. Raising fetch.min.bytes trades latency for efficiency, so latency-sensitive consumers keep the default.
Open with
I think of the consumer as two layers. Underneath, it sends fetch requests, one at a time to each broker that leads its partitions, and puts the responses in a buffer.
Then, if they want more
On top, poll hands records from that buffer to my code. The broker treats a fetch like a long poll: it answers once it has fetch.min.bytes of data, one byte by default so effectively as soon as anything exists, or after fetch.max.wait.ms, 500 milliseconds, whichever comes first.
The size of the answer is limited by max.partition.fetch.bytes, one megabyte per partition, and fetch.max.bytes, 50 megabytes for the whole response. Both are soft in one way: if the first batch in a partition is bigger than the limit, the broker still returns it, otherwise the consumer would be stuck.
Incremental fetch sessions keep repeated requests small by only sending what changed. max.poll.records, 500 by default, is a different thing entirely: it only caps how many already-buffered records one poll returns, so it controls processing time per loop and has no effect on fetch sizes.
For tuning, raising fetch.min.bytes to something like 256 kilobytes gives fewer, bigger responses and better efficiency for bulk consumers, at the cost of up to fetch.max.wait.ms of latency, so latency-sensitive consumers keep the default.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Kafka documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Explain fetch.min.bytes, fetch.max.wait.ms, max.partition.fetch.bytes, fetch.max.bytes...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-clients-in-depth/6f07abd7b1/