'ksqldb high disk usage problem(disk usage tends to increase indefinitely)

I am currently using Ksqldb in the k8s environment. I am using TABLE for aggregate operations. Since it is a stateful operation, ksqldb is expected to be using rocksdb . One problem is that local disk usage tends to increase indefinitely over time.

I got the following hint about high disk usage from the link. https://www.confluent.io/ko-kr/blog/how-to-tune-rocksdb-kafka-streams-state-stores-performance/

Kafka Streams uses universal compaction by default for its state stores. However, level compaction has lower space 
amplification than universal compaction at the cost of lower write rates. The corresponding option that you can tune in your 
RocksDBConfigSetter implementation is options.setCompactionStyle(CompactionStyle.LEVEL).

I couldn't find how to apply the options.setCompactionStyle(CompactionStyle.LEVEL) setting in the ksqldb documentation. Can you tell me how to apply the setting or how to handle so that the local disk of ksqldb does not grow indefinitely?

thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source