Problem:
The client, operating a Kafka Streams application version 3.3.1, encountered significant issues with managing changelog topics. Despite configuring the application for automatic record cleanup, the changelog topics exhibited unchecked growth. This accumulation of records risked deteriorating system performance and stability, potentially impacting the application’s reliability.
Process:
Initial Assessment:
Issue Reporting: The client highlighted problems related to the unexpected growth of records in changelog topics despite existing cleanup configurations.
Application Design Review: Our experts reviewed the Kafka Streams application’s design, focusing on its use of window-based aggregations and the cleanup policy set to compact.
Configuration Analysis:
Configuration Scrutiny: Experts analyzed the Kafka Streams configuration parameters, including retention settings, state cleanup delays, and application-level overrides.
Policy Evaluation: The review involved examining the retention and cleanup policies applied to the changelog topics, assessing their effectiveness, and identifying potential areas of improvement.
Solution Development:
Uniform Retention Configuration: Experts recommended standardizing retention parameters across the application to ensure consistent cleanup intervals. The proposed settings included:
- log.retention.hours=48
- log.retention.ms=172800000 (48 hours)
- log.segment.bytes=1073741824 (1 GB)
- log.retention.check.interval.ms=300000 (5 minutes)
- num.io.threads=48
- num.network.threads=32
- num.partitions=5
- offsets.retention.minutes=2880 (48 hours)
Optimized Cleanup Mechanisms: To further enhance cleanup efficiency, experts recommended:
- Adjusting Dirty Ratio Settings: Fine-tuning the dirty ratio settings to expedite cleanup processes.
- Enhancing Cleaner Thread Frequency: Increasing the frequency of cleaner thread operations to prevent excessive record accumulation.
Reference Materials: The client was provided with detailed resources to support understanding and implementation:
- Medium: Kafka Message Retention vs Committed Offset Retention
- Conduktor: Kafka Topic Configuration – Log Retention
- Conduktor Blog: Understanding Kafka’s Internal Storage and Log Retention
Solution:
Implemented Changes:
Retention Configuration: The standardized retention settings were applied, aligning cleanup intervals across the application and improving consistency.
Cleanup Optimization: The adjustments to dirty ratio settings and cleaner thread frequency effectively mitigated unchecked record growth in changelog topics.
Outcome:
Improved Stability: The application experienced enhanced stability and performance due to more controlled record management in changelog topics.
Enhanced Reliability: The optimized cleanup mechanisms ensured that the Kafka Streams application operated smoothly, handling peak loads and maintaining performance.
Conclusion:
Through the expert-driven solution, including uniform retention configurations and optimized cleanup mechanisms, the client successfully resolved the issues with unmanaged record growth in Kafka Streams changelog topics. These improvements addressed the performance and stability concerns, leading to a more reliable and efficient application environment. The client benefited from enhanced system stability and performance, ensuring the smooth operation of their Kafka Streams application.