Kafka Consumer Throughput Configuration
Evaluate fetch sizes and processing budgets for sustained consumption.
consumer
| Config / reference | Default → proposal | Rationale and conditions |
|---|---|---|
| Fetching and processing | ||
| fetch.min.bytes Java client 4.4 Evaluate | 1 B → 64 KiB | Sets the desired minimum fetch response size; the broker can wait up to the fetch wait limit for enough data. Tradeoff: Larger thresholds can reduce request overhead but delay low-rate streams. Response size is workload-dependent. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: Sparse traffic with a latency budget smaller than the fetch wait. Measure: fetch-size-avg, fetch-rate and end-to-end consumer latency Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| fetch.max.wait.ms Java client 4.4 Keep | 500 ms (unchanged) | Bounds how long the broker waits to satisfy the minimum data requirement for a consumer fetch. Tradeoff: Shorter waits can increase fetch traffic when little data is available. This is not a bound on processing or all consumer latency. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: Reducing the wait without checking fetch.min.bytes and idle request traffic. Measure: fetch-rate, fetch-latency-avg and low-traffic delivery latency Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| fetch.max.bytes Java client 4.4 Evaluate | 50 MiB → 100 MiB | Sets a fetch response size target. A first oversized record batch may still be returned to allow progress. Tradeoff: Consumers can fetch from multiple brokers concurrently, so this is not a process memory cap. Larger responses require processing and memory headroom. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: Sizing process memory as exactly this value or assuming it is an absolute record limit. Measure: fetch-size-max, consumer memory, processing time and broker fetch traffic Fetch byte settings are not absolute caps: an oversized first record batch can be returned to ensure progress. Review aggregate memory across partitions and brokers. Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| max.partition.fetch.bytes Java client 4.4 Evaluate | 1 MiB → 4 MiB | Sets the fetch target per partition. The first oversized batch can exceed this value to allow progress. Tradeoff: Total memory also depends on partitions, brokers and concurrent fetches. Coordinate with producer record-batch sizes. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: Treating this target as a strict cap or using it to validate the maximum legal record size. Measure: per-partition batch size, memory, lag and fetch response sizes Fetch byte settings are not absolute caps: an oversized first record batch can be returned to ensure progress. Review aggregate memory across partitions and brokers. Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| max.poll.records Java client 4.4 Evaluate | 500 → 2000 | Limits how many cached records a Java poll() returns. It does not change the underlying fetch size. Tradeoff: A larger poll batch can extend processing time. librdkafka has no direct configuration equivalent. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: A batch processing time that can exceed max.poll.interval.ms. Measure: poll batch size, processing p99, time between polls and rebalances Allow for processing tail latency, downstream I/O and pauses between polls. Static members can retain partitions until session timeout after a poll interval breach. Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| max.poll.interval.ms Java client 4.4 Evaluate | 5 min → 10 min | Bounds the interval between consumer poll calls for group liveness. Size it for processing and downstream tail latency. Tradeoff: A longer interval delays detecting a stuck application. Static membership changes when partitions are reassigned after a poll timeout. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: Choosing the interval from average processing time alone. Measure: time-between-poll-max, processing p99, rebalance frequency and lag Allow for processing tail latency, downstream I/O and pauses between polls. Static members can retain partitions until session timeout after a poll interval breach. Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| Consumer group and offsets | ||
| session.timeout.ms Java client 4.4 Keep | 45 s (unchanged) | With the classic group protocol, controls failure detection when heartbeats stop; broker min/max bounds apply. Tradeoff: Shorter sessions can evict healthy members during pauses. With group.protocol=consumer, the broker controls the session timeout instead. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: Applying this client setting to the consumer group protocol. Measure: heartbeat gaps, coordinator errors and rebalance frequency These client heartbeat, session and assignor settings describe the classic group protocol. With consumer protocol, broker-side settings and assignors apply. Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| heartbeat.interval.ms Java client 4.4 Keep | 3 s (unchanged) | With the classic protocol, schedules heartbeats and should be below session.timeout.ms; typically no more than one third of it. Tradeoff: More frequent heartbeats add traffic. With group.protocol=consumer, the broker controls heartbeat timing. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: Applying this client setting to the consumer protocol or using a fixed missed-heartbeat count as a failure guarantee. Measure: heartbeat-response-time-max, heartbeat gaps and group stability These client heartbeat, session and assignor settings describe the classic group protocol. With consumer protocol, broker-side settings and assignors apply. Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| enable.auto.commit Java client 4.4 Keep | true (unchanged) | Controls periodic offset commits. With false, the application must coordinate commits with successful processing. Tradeoff: Disabling auto commit does not implement exactly-once processing. Crashes can replay uncommitted work, and committing before completion can skip work. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: An application without explicit, tested offset management. Measure: commit failures, replay after restart, processed-versus-committed offsets Manual commits and read_committed do not alone implement exactly-once processing. Commit only completed work; handle commit failures and possible replay. In librdkafka, review enable.auto.offset.store as well. Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| auto.commit.interval.ms Java client 4.4 Keep | 5 s (unchanged) | Controls periodic offset commit frequency when auto commit is enabled. Tradeoff: It does not define a precise replay window or prove that asynchronous processing has completed. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: Assuming timed commits safely coordinate arbitrary asynchronous processing. Measure: commit rate, commit failures and recovery replay Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| partition.assignment.strategy Java client 4.4 Evaluate | class org.apache.kafka.clients.consumer.RangeAssignor,class org.apache.kafka.clients.consumer.CooperativeStickyAssignor → org.apache.kafka.clients.consumer.CooperativeStickyAssignor | For classic groups, CooperativeStickyAssignor can reduce reassignment disruption. All members need a compatible migration strategy. Tradeoff: Java class names are not librdkafka assignor names. Follow the rolling migration procedure; consumer-protocol assignment uses broker-side assignors. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: Switching an existing group without checking common assignors and the supported migration path. Measure: rebalance duration, revoked partitions and processing interruptions These client heartbeat, session and assignor settings describe the classic group protocol. With consumer protocol, broker-side settings and assignors apply. Follow the documented rolling assignor migration; classic group members need a common compatible assignor. Java class names must not be copied into librdkafka. Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| group.instance.id Java client 4.4 Manual decision | unset → <unique-per-instance-id> Commented out in export; prerequisites require review. | Enables static group membership with a stable logical instance identity. Tradeoff: Concurrent members must not share an ID. Failure detection and partition reassignment can be delayed by session timeout. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: An autoscaling deployment that cannot maintain unique stable identities. Measure: fencing errors, rebalance frequency and failover time Static instance IDs must be stable across restarts and unique among concurrent members of the same group. Duplicate IDs cause fencing. Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| group.protocol Java client 4.4 Keep | classic (unchanged) | These group-management recommendations use the classic protocol. Choose consumer explicitly to use the newer broker-managed protocol. Tradeoff: Classic session, heartbeat and client assignor settings do not apply to the consumer protocol. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: A deliberate migration to the consumer protocol. Measure: group protocol, rebalance behavior and coordinator errors These client heartbeat, session and assignor settings describe the classic group protocol. With consumer protocol, broker-side settings and assignors apply. Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| Network and buffers | ||
| receive.buffer.bytes Java client 4.4 Evaluate | 64 KiB → 1 MiB | Requests a TCP receive buffer size for client connections. Tradeoff: Kernel defaults, autotuning and limits affect the result. More buffer capacity may be unused on low-volume response paths. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: A memory-constrained client without a measured receive bottleneck. Measure: effective SO_RCVBUF, socket memory, bytes received and request latency Java socket buffers use -1 for the OS default. librdkafka uses 0. Effective allocation and autotuning depend on the OS. Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |
| Other controls | ||
| connections.max.idle.ms Java client 4.4 Keep | 9 min (unchanged) | Controls how long idle client connections may remain open. Tradeoff: Longer-lived connections retain resources; shorter intervals can add connection and authentication work. Network intermediaries may impose their own timeouts. Workload, validation and sourcesWorkload: Sustained consumption with sufficient memory and bounded processing time. Avoid when: An idle timeout inconsistent with load balancers or connection resource limits. Measure: connection creation/close rate, authentication latency and file descriptors Versioned reference · 2026-10-27 · unbenchmarked tuning proposal |