pika icon indicating copy to clipboard operation
pika copied to clipboard

WIKI 配置信息能否补充大部分场景下的最优配置

Open klboke opened this issue 1 year ago • 4 comments

https://github.com/OpenAtomFoundation/pika/wiki/pika-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E8%AF%B4%E6%98%8E

比如

# pika是多线程的, 该参数能够配置pika的线程数量, 不建议配置值超过部署服务器的CPU核心数量 
thread-num : 1

# 处理命令用户请求命令线程池的大小
thread-pool-size : 8

thread-pool-size 和 thread-num 有关系么?如果有关系,是 1:8 的关系是最优的么?能否结合压测的结果,给出大致的最优组合建议呢?

klboke avatar Sep 22 '23 02:09 klboke

https://github.com/OpenAtomFoundation/pika/wiki/pika-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E8%AF%B4%E6%98%8E

比如

# pika是多线程的, 该参数能够配置pika的线程数量, 不建议配置值超过部署服务器的CPU核心数量 
thread-num : 1

# 处理命令用户请求命令线程池的大小
thread-pool-size : 8

thread-pool-size 和 thread-num 有关系么?如果有关系,是 1:8 的关系是最优的么?能否结合压测的结果,给出大致的最优组合建议呢?

好的,我们这边会给出一份最佳的线上压测配置

Mixficsol avatar Sep 22 '23 06:09 Mixficsol

https://github.com/OpenAtomFoundation/pika/wiki/3.2.x-Performance

性能压测最好可以被社区用户方便的复现。目前缺少 pika.conf 的信息

chejinge avatar Sep 25 '23 01:09 chejinge

https://github.com/OpenAtomFoundation/pika/issues/2007

klboke avatar Sep 25 '23 09:09 klboke

based on v3.5.1, you can optimize some parameters as follows.

1 Adjust `max-background-flushes` and `max-background-compaction` to 4 to increase the number of threads for compaction and flushdb. Adjust max-background-jobs to 8.
2 Adjust the `block-cache` to be 60% of the memory allocated to the Pika instance.
3 Uncomment `share-block-cache` and set it to yes.
4 Adjust `thread-num` to 80% of the CPU cores of the Pika instance.
5 Adjust `thread-pool-size` to CPU cores * 1.5.
6 Set `rate-limiter-bandwidth` to 2000Mib/s for gigabit Ethernet and 10000Mib/s for 10-gigabit Ethernet.

in Chinese:

  1. max-background-flushesmax-backgroud-compaction可以调整到 4,提高 compaction 和 flushdb 的线程数, max-backgroumd-jobs调整到 8
  2. block-cache的大小可以调整为分给 Pika 实例内存的 60%
  3. share-block-cache解除注释,改为yes
  4. thread-num调整为 Pika 实例的 CPU 核数的 80%
  5. thread-pool-size调整为 CPU 核数 * 1.5
  6. rate-limiter-bandwidth:千兆网卡2000Mib/s 万兆网卡:10000Mib/s

Mixficsol avatar Oct 23 '23 11:10 Mixficsol