Fetch Session Cache Thrashing from Consumer Pattern
warningWhen 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.
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.
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.