heartbeat.interval.ms — Kafka Consumer Configuration
The expected time between heartbeats to the group coordinator when using Kafka's group management facilities. Heartbeats are used to ensure that the worker's session stays active and to facilitate rebalancing when new members join or leave the group.
Description
The expected time between heartbeats to the group coordinator when using Kafka's group management facilities. Heartbeats are used to ensure that the worker's session stays active and to facilitate rebalancing when new members join or leave the group. The value must be set lower than session.timeout.ms, but typically should be set no higher than 1/3 of that value. It can be adjusted even lower to control the expected time for normal rebalances.
Default Values by Kafka Version
| Kafka Version | Default Value |
|---|---|
| 0.9.0 | 3000 |
| 0.10.0 | 3000 |
| 0.10.1 | 3000 |
| 0.10.2 | 3000 |
| 0.11.0 | 3000 |
| 1.0 | 3000 |
| 1.1 | 3000 |
| 2.0 | 3000 |
| 2.1 | 3000 |
| 2.2 | 3000 |
| 2.3 | 3000 |
| 2.4 | 3000 |
| 2.5 | 3000 |
| 2.6 | 3000 (3 seconds) |
| 2.7 | 3000 (3 seconds) |
| 2.8 | 3000 (3 seconds) |
| 3.0 | 3000 (3 seconds) |
| 3.1 | 3000 (3 seconds) |
| 3.2 | 3000 (3 seconds) |
| 3.3 | 3000 (3 seconds) |
| 3.4 | 3000 (3 seconds) |
| 3.5 | 3000 (3 seconds) |
| 3.6 | 3000 (3 seconds) |
| 3.7 | 3000 (3 seconds) |
| 3.8 | 3000 (3 seconds) |
| 3.9 | 3000 (3 seconds) |
| 4.0 | 3000 (3 seconds) |
| 4.1 | 3000 (3 seconds) |
| 4.2 | 3000 (3 seconds) |
Tuning Recommendation
| Profile | Recommended | Why |
|---|---|---|
| consumer / throughput | 3000 | Heartbeats run on a background thread independent of poll(); the 3s default sends ~15 heartbeats per session.timeout.ms window (45s / 3s), providing adequate failure detection without adding network overhead. Lowering it wastes CPU and network on heartbeat RPCs that add no throughput value. |
| consumer / latency | 2000 | With session.timeout.ms=10s, reducing heartbeat interval to 2s maintains the 1:5 ratio (session / heartbeat) needed for reliable liveness detection. Sends heartbeats 5x per session window, allowing 4 missed beats before timeout — sufficient to survive transient GC pauses. |
Related Configs
max.poll.interval.ms · session.timeout.ms
Manage Kafka configs across all your clusters with Conduktor Console — view, compare, and update configurations in one place.