说明

Tendis存储版提供了非常灵活的参数配置供使用者去调优,包括不同线程池大小,rocksdb的配置等等。

以下是一个NVME的配置参考,供参考。

硬件配置

  1. CPU:2.50 GHz,48 core
  2. DISK:NVMe SSD
  3. MEM:192GB

配置模板

  1. bind 127.0.0.1
  2. port 51002
  3. loglevel notice
  4. cluster-enabled on
  5. storage rocks
  6. pidfile ./home/tendisplus.pid
  7. # 数据和日志目录要提前创建
  8. logdir ./home/log
  9. dir ./home/db
  10. dumpdir ./home/dump
  11. # tendis的密码,按需指定
  12. #requirepass tendis+test
  13. #masterauth tendis+test
  14. # binlog清理相关参数
  15. truncateBinlogIntervalMs 1000
  16. truncateBinlogNum 5000000
  17. # 网络线程池数量,建议cpu数量/4,
  18. netiothreadnum 8
  19. # 工作线程池数量,建议略多于cpu数量
  20. executorthreadnum 56
  21. # 其他线程池数量配置,根据实际情况配置,想看参数配置
  22. # incrPushThreadnum 4
  23. # migrateSenderThreadnum 2
  24. # migrateReceiveThreadnum 4
  25. # migrateClearThreadnum 2
  26. # rocksdb的blockcache大小,建议使用30%系统内存
  27. rocks.blockcachemb 68719476736
  28. # rocksdb相关配置
  29. rocks.blockcache_strict_capacity_limit 0
  30. rocks.cache_index_and_filter_blocks 1
  31. rocks.max_open_files -1
  32. rocks.compress_type snappy
  33. #rocks.level0_compress_enabled no
  34. #rocks.level1_compress_enabled no
  35. rocks.level_compaction_dynamic_level_bytes 1
  36. # [n >= 4, n <= 64, n ~= cpu_cores]
  37. rocks.max_background_compactions 64
  38. #rocks.max_write_buffer_number 16
  39. #rocks.min_write_buffer_number_to_merge 14
  40. rocks.write_buffer_size 67108864
  41. rocks.target_file_size_base 67108864
  42. rocks.max_bytes_for_level_base 536870912
  43. # mapping-command dbsize emptyint
  44. # mapping-command keys emptymultibulk
  45. # 数据迁移相关配置
  46. cluster-migration-slots-num-per-task 10
  47. cluster-migration-rate-limit 500
  48. cluster-migration-binlog-iters 20
  49. cluster-migration-distance 10000