session.timeout.ms — Kafka Consumer Configuration
The timeout used to detect worker failures. The worker sends periodic heartbeats to indicate its liveness to the broker.
Description
The timeout used to detect worker failures. The worker sends periodic heartbeats to indicate its liveness to the broker. If no heartbeats are received by the broker before the expiration of this session timeout, then the broker will remove the worker from the group and initiate a rebalance. Note that the value must be in the allowable range as configured in the broker configuration by group.min.session.timeout.ms and group.max.session.timeout.ms.
Default Values by Kafka Version
| Kafka Version | Default Value |
|---|---|
| 0.9.0 | 30000 |
| 0.10.0 | 30000 |
| 0.10.1 | 10000 |
| 0.10.2 | 10000 |
| 0.11.0 | 10000 |
| 1.0 | 10000 |
| 1.1 | 10000 |
| 2.0 | 10000 |
| 2.1 | 10000 |
| 2.2 | 10000 |
| 2.3 | 10000 |
| 2.4 | 10000 |
| 2.5 | 10000 |
| 2.6 | 10000 (10 seconds) |
| 2.7 | 10000 (10 seconds) |
| 2.8 | 10000 (10 seconds) |
| 3.0 | 45000 (45 seconds) |
| 3.1 | 45000 (45 seconds) |
| 3.2 | 45000 (45 seconds) |
| 3.3 | 45000 (45 seconds) |
| 3.4 | 45000 (45 seconds) |
| 3.5 | 45000 (45 seconds) |
| 3.6 | 45000 (45 seconds) |
| 3.7 | 45000 (45 seconds) |
| 3.8 | 45000 (45 seconds) |
| 3.9 | 45000 (45 seconds) |
| 4.0 | 45000 (45 seconds) |
| 4.1 | 45000 (45 seconds) |
| 4.2 | 45000 (45 seconds) |
Tuning Recommendation
| Profile | Recommended | Why |
|---|---|---|
| consumer / throughput | 45000 | The 45s default is well-suited for high-throughput scenarios: long enough to survive GC pauses or broker failovers without triggering unnecessary rebalances, short enough to detect genuinely dead consumers within a reasonable window. |
| consumer / latency | 10000 | Reducing session timeout to 10s enables faster failover: when a consumer crashes, its partitions are reassigned within 10s instead of 45s, maintaining low lag for other consumers in the group. Critical for latency-sensitive pipelines where lag accumulation during failover is unacceptable. |
| consumer / durability | 45000 | The 45s default is appropriate for durable consumers: long enough to survive JVM GC pauses, network blips, and coordinator elections without triggering unnecessary rebalances that interrupt in-progress commits. Reducing it increases rebalance frequency, which is the primary cause of duplicate processing in at-least-once consumers. |
Related Configs
max.poll.interval.ms · heartbeat.interval.ms · partition.assignment.strategy · group.instance.id · request.timeout.ms
Manage Kafka configs across all your clusters with Conduktor Console — view, compare, and update configurations in one place.