Quick revision
The short answer
Thirty-day-old data on a tiered topic is not on the broker at all: each read goes to the object store, pays its first-byte latency and request overhead, and gets nothing from the page cache. Brokers serve these reads from a small dedicated thread pool that queues when several replays run together. We improve it by reading many partitions in parallel with larger fetch sizes, enlarging the remote reader pool, using the plugin's cache and keeping the store in the same region, and we set expectations that latency-sensitive replay needs longer local retention or another store.
What to remember
In this answer, we saw that old data on a tiered topic is served from the object store, so each fetch pays first-byte latency and request overhead, gets nothing from the page cache, and may wait in the broker's remote reader pool. Per-partition throughput is bounded by round trips, so we tune with larger fetches, more partitions in parallel, a properly sized reader pool, the plugin's cache and a same-region bucket. When replay of old data must be fast, the honest answer is longer local retention or another store.
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.
Thirty-day-old data on a tiered topic is not on the broker at all: each read goes to the object store, pays its first-byte latency and request overhead, and gets nothing from the page cache. Brokers serve these reads from a small dedicated thread pool that queues when several replays run together. We improve it by reading many partitions in parallel with larger fetch sizes, enlarging the remote reader pool, using the plugin's cache and keeping the store in the same region, and we set expectations that latency-sensitive replay needs longer local retention or another store.
Why this question is asked
Teams adopt tiered storage for cheaper retention and then discover that reading old data feels very different from reading new data. Fetch latencies of seconds and 15 MB/s per partition can look like a bug, but they follow directly from how remote reads work. Interviewers ask this to see whether we can explain that mechanism and separate what can be tuned from what is simply the nature of object storage. In this answer, we will recap the two read paths, see where the time goes on a remote read, and then go through the client, broker and plugin settings we can change, and when tuning is the wrong answer.
1A Quick Recap: Two Read Paths
On a tiered topic, recent segments are on the broker's local disk and usually in the page cache, the kernel's memory copy of recently used file blocks. A consumer near the head gets its data from memory through zero-copy, which explains the single-digit millisecond fetches.
Older segments, beyond local.retention.ms, exist only in remote storage such as S3. When a consumer asks for an offset that old, the broker has to find the remote segment through the remote log metadata, read the right byte range from the object store through the RemoteStorageManager plugin, and only then build the fetch response.
2Where the Time Goes on a Remote Read
A read from an object store is an HTTP request. Even inside the same region, the time to the first byte is commonly tens of milliseconds and sometimes far more under load, and each request has a fixed overhead regardless of how much data it returns. Nothing is cached in the page cache for these old segments, so every fetch pays that cost again, unless the plugin caches.
7 messages in order. Play them, or step through them one at a time.
Each round trip to the object store adds latency; a small fetch size means many round trips per MB.
Brokers do not run remote reads on the normal request handler threads, because a slow object store would block every client. Instead, they hand them to a dedicated pool of remote reader threads (remote.log.reader.threads, with a related limit on pending tasks; check the names and defaults for your version). When several consumers replay old data at once, tasks queue in that pool and waiting time adds to every fetch. That is how a fetch reaches 1 to 3 seconds.
The throughput number follows from the latency. If each fetch returns 1 MB of a partition and a round trip to the store takes around 60 ms on average, one partition can only move about 15 MB per second when the consumer waits for each response before asking for the next. Notice that the bottleneck is round trips, not bandwidth.
3Tuning the Consumer: Bigger Fetches, More Partitions at Once
Because the cost is per request, we make each request return more data and run more requests in parallel. A consumer with larger fetch limits gets more bytes per round trip, and a consumer group with more members, or a consumer assigned many partitions, keeps several remote reads in flight.
Larger fetches help only if the plugin reads remote data in large enough chunks, so we check the plugin's own chunk or prefetch settings too. Some versions also limit how much remote data one fetch request can return across partitions, which is another reason to spread partitions over more consumers. Check your version's notes.
4Tuning the Broker and the Plugin
On the broker, we size the remote reader pool for the number of replays we expect at once, and watch its queue and the remote fetch metrics. If the pool is busy and the queue grows, more threads help as long as the store and the network have capacity.
In the plugin, a cache is the biggest lever. Some open-source plugins keep recently read chunks in memory or on a local disk cache, so a consumer that reads a segment sequentially fetches each chunk from the store once and then hits the cache for nearby offsets. We also keep the bucket in the same region as the brokers: a cross-region bucket adds latency to every request and data transfer charges to every byte.
5Setting Expectations
Even after tuning, a remote read will not match a page cache read. Tiered storage exists to make long retention cheap and occasional replay possible, not to give old data the same latency as new data. If a team needs fast replay of the last week, for example to rebuild a service's state within minutes, the right answer is a longer local.retention.ms for that topic, or a separate store designed for that access pattern, such as a lake table for analytics. We should say this clearly when the topic is set up, with measured numbers from a replay test, so nobody discovers it during an incident.
6Follow-up questions
Would a larger page cache help these reads?
Not directly. Remote segments are not on local disk, so the page cache never holds them. A plugin with a local disk cache can make repeated or nearby reads cheaper, and that cache may in turn benefit from the page cache, but the first read of each chunk always goes to the object store.
How do you tell whether the bottleneck is the reader pool or the object store?
Look at the remote read metrics on the broker: if the queue of pending remote read tasks grows and tasks wait long before starting, the pool is too small. If tasks start quickly but each read takes long, the store or the network is slow, and more threads will not help much. The object store's own request latency metrics confirm it.
Do remote reads cost money?
Yes. Each GET request to an object store is billed, and cross-region or internet transfer is billed per GB. Small fetch sizes create many requests, so larger chunks lower cost as well as latency.
7Conclusion
In this answer, we saw that old data on a tiered topic is served from the object store, so each fetch pays first-byte latency and request overhead, gets nothing from the page cache, and may wait in the broker's remote reader pool. Per-partition throughput is bounded by round trips, so we tune with larger fetches, more partitions in parallel, a properly sized reader pool, the plugin's cache and a same-region bucket. When replay of old data must be fast, the honest answer is longer local retention or another store.
Open with
The consumers near the head read data that is on local disk and in the page cache, so they get single-digit milliseconds. The 30-day-old data is only in remote storage.
Then, if they want more
For each fetch the broker has to look up the remote segment and read the byte range from the object store through the plugin, and every one of those reads pays the store's first-byte latency, often tens of milliseconds and more under load, with nothing coming from the page cache.
Brokers run these reads on a dedicated remote reader thread pool, so when several replays run at once, tasks queue and the fetch climbs to one to three seconds. The 15 MB/s per partition is really a round-trip limit: if each fetch returns about 1 MB and a round trip takes around 60 ms, that is roughly what you get.
So I would tune for fewer, bigger round trips and more parallelism: larger max.partition.fetch.bytes and fetch.max.bytes, more consumers or more partitions read at once, and a bigger remote reader pool if its queue is growing, checking the exact setting names for the version.
In the plugin I would turn on its chunk cache if it has one and make sure the bucket is in the same region. And I would set expectations: tiered storage is for cheap retention and occasional replay. If someone needs fast replay of old data, they need longer local retention or a different store.
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 why and what you would tune.": https://scrivio-interview-library.netlify.app/spring-boot/kafka-internals/48c6ad11ae/