Tencent / Tendis

Tendis is a high-performance distributed storage system fully compatible with the Redis protocol.
http://tendis.cn
Other
2.91k stars 319 forks source link

Tendis使用内存高于Rocksdb的使用内存,高了约40% #172

Open y1825181 opened 2 years ago

y1825181 commented 2 years ago

大量数据导入到Tendis后,发现Tendis使用内存,远高于配置的rocksdb的BlockCache大小,相关查询和配置信息如下

Server

redis_version:2.3.6-rocksdb-v5.13.4 redis_git_sha1:532b9a95 redis_git_dirty:0 redis_build_id:13480377323411654960 redis_mode:cluster TENDIS_DEBUG:OFF os:Linux 3.10.0-514.44.5.10.h193.x86_64 x86_64 arch_bits:64 multiplexing_api:asio

Memory

used_memory:-1 used_memory_human:-1 used_memory_rss:144500314112 used_memory_rss_human:141113588kB used_memory_peak:-1 used_memory_peak_human:-1 total_system_memory:-1 total_system_memory_human:-1 used_memory_lua:-1 used_memory_vir:179227385856 used_memory_vir_human:175026744kB used_memory_vir_peak_human:175026748kB used_memory_rss_peak_human:141113596kB

Dataset

rocksdb.kvstore-count:12 rocksdb.total-sst-files-size:16065375333 rocksdb.binlogcf-sst-files-size:16058832890 rocksdb.live-sst-files-size:16065375333 rocksdb.estimate-live-data-size:10023256882 rocksdb.estimate-num-keys:440448567 rocksdb.total-memory:107465296390 rocksdb.cur-size-all-mem-tables:91605760 rocksdb.estimate-table-readers-mem:0 rocksdb.blockcache.capacity:107374182400 rocksdb.blockcache.usage:107373690630 rocksdb.blockcache.pinnedusage:30707685 rocksdb.mem-table-flush-pending:0 rocksdb.estimate-pending-compaction-bytes:0 rocksdb.compaction-pending:0 rocksdb.number.iter.skip:875109372 rocksdb.compaction-filter-count:10499872981 rocksdb.compaction-kv-expired-count:0

配置 pidfile ../tendisplus.pid slowlog ../log/slowlog rocks.blockcachemb 102400 executorWorkPoolSize 40 executorThreadNum 160 truncateBinlogNum 500000 binlogDelRange 10000 maxBinlogKeepNum 20 minBinlogKeepSec 86400 jeprof-auto-dump false netiothreadnum 40 maxClients 50000 deletefilesinrange-for-binlog true rocks.cache_index_and_filter_blocks 1 rocks.pin_l0_filter_and_index_blocks_in_cache 1 rocks.optimize_filters_for_hits 0 kvstorecount 12

环境为88cpu,内存752GB,硬盘都为SSD

tendis使用内存约140GB,实际Rocksdb查询来看,占用为100GB。 看下还有那些配置可以优化相关的内存使用

takenliu commented 1 month ago

内存占用,参考文档: http://tendis.cn/#/Tendisplus/知识库/FAQ Q: tendis的内存占用是多少