【发布时间】:2019-11-01 22:02:29
【问题描述】:
我试图找出我的 kafka-streams 应用程序内存不足的原因。 我已经发现 rocksDB 正在消耗大量本机内存,我尝试使用以下配置来限制它:
# put index and filter blocks in blockCache to avoid letting them grow unbounded (https://github.com/facebook/rocksdb/wiki/Block-Cache#caching-index-and-filter-blocks)
cache_index_and_filter_blocks = true;
# avoid evicting L0 cache of filter and index blocks to reduce performance impact of putting them in the blockCache (https://github.com/facebook/rocksdb/wiki/Block-Cache#caching-index-and-filter-blocks)
pinL0FilterAndIndexBlocksInCache=true
# blockCacheSize should be 1/3 of total memory available (https://github.com/facebook/rocksdb/wiki/Setup-Options-and-Basic-Tuning#block-cache-size)
blockCacheSize=1350 * 1024 * 1024
# use larger blockSize to reduce index block size (https://github.com/facebook/rocksdb/wiki/RocksDB-Tuning-Guide#difference-of-spinning-disk)
blockSize=256 * 1024
但内存使用量似乎仍在无限增长,我的容器最终会被 OOMKilled。
我使用 jemalloc 来分析内存使用情况 (like described here) 和 结果清楚地表明rocksDB负责,但我不知道如何进一步限制rocksDB的内存使用。
我不知道这是否有帮助,但为了完整起见,这里是从正在运行的 RocksDB 实例收集的统计信息:
我很高兴有任何提示
【问题讨论】:
标签: java apache-kafka-streams rocksdb