Apache Kafka

Fetch Session Cache Thrashing from Consumer Pattern

warning
performanceUpdated Mar 2, 2026

When fetch sessions are evicted frequently, it indicates consumers are not maintaining stable fetch patterns, causing the broker to rebuild fetch contexts repeatedly and increasing CPU overhead.

Technologies:
How to detect:

Monitor kafka.session.fetch_eviction_rate > 10/sec while kafka.session.fetch_count remains stable or decreasing. This indicates sessions are being created and evicted rapidly rather than being reused.

Recommended action:

1. Increase max.incremental.fetch.session.cache.slots: Allocate more cache slots for fetch sessions. 2. Review consumer patterns: Identify consumers that frequently reconnect or change fetch patterns. 3. Use consumer groups consistently: Avoid frequently creating/destroying consumer instances. 4. Monitor consumer rebalances: Frequent rebalances cause session churn. 5. Check connection stability: Network issues may cause session drops.