首页 > 数据库 >Redis IO多线程的简要测试结果

Redis IO多线程的简要测试结果

时间:2023-02-21 19:55:12浏览次数:100  
标签:20 0.1 3052 Redis IO 954204 多线程 root 1725812

Redis IO多线程的简要测试结果


摘要

最近想简单确认一下IO多线程的对吞吐量的提升情况.
正好手头有鲲鹏的机器, 所以想直接进行一下验证
顺便用一下4216 进行一下对比. 

发现 在CPU核心比较多的情况下 8个IO线程吞吐量能够翻一番. 
但是部分命令在4-8线程增加时 差异并不是特别明显. 

silver 4216 低价位的intelCPU比鲲鹏920的 吞吐量要高一些, 单没有搞多少.
纯粹压测, 看不太出来绑核与不绑核的差异. 

测试命令

./redis-benchmark -h 127.0.0.1 -p 6376 -n 100000 -c 8000 -d 256 --threads 1
# 注意我选择 10万个keys 8000个client 简直大小选择 256字节.
# 注意默认大小是 3个字节, 数值会比较好看,我想把简直设置大一些会好一点
 cat 6376_1threads.txt | grep -E "requests per second|====="
通过这个命令进行简要分析出具结果

测试方式

鲲鹏 920 64核心 两路服务器
2.6Ghz 128Core的服务器上面
使用 1 2 4 8  四种线程数量跑四遍

压测过程中使用 top -Hp的方式查看CPU的使用情况:
比如发现某个进程
 13276 root      20   0 2278756   1.2g   3080 R 99.7  0.1   1:01.29 io_thd_1                                                                                                                                                              
 13271 root      20   0 2278756   1.2g   3080 R 99.0  0.1   1:07.60 redis-server 
这是两个线程时的监控情况. 
出现CPU 高时 主要是执行LGANGE的测试.. GET和SET不会到达这么搞的占用. 

如果是四个线程会出现如下的情况:
  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                                                                                                                                               
 35666 root      20   0 1725812 954204   3052 R 99.9  0.1   0:21.90 io_thd_1                                                                                                                                                              
 35667 root      20   0 1725812 954204   3052 R 99.9  0.1   0:21.89 io_thd_2                                                                                                                                                              
 35668 root      20   0 1725812 954204   3052 R 99.9  0.1   0:21.89 io_thd_3                                                                                                                                                              
 35661 root      20   0 1725812 954204   3052 R 99.7  0.1   0:27.58 redis-server                                                                                                                                                          
 35663 root      20   0 1725812 954204   3052 S  0.0  0.1   0:00.00 bio_close_file                                                                                                                                                        
 35664 root      20   0 1725812 954204   3052 S  0.0  0.1   0:00.00 bio_aof_fsync                                                                                                                                                         
 35665 root      20   0 1725812 954204   3052 S  0.0  0.1   0:00.00 bio_lazy_free                                                                                                                                                         
 35669 root      20   0 1725812 954204   3052 S  0.0  0.1   0:00.25 jemalloc_bg_thd                                                                                                                                                       
 37399 root      20   0 1725812 954204   3052 S  0.0  0.1   0:00.00 jemalloc_bg_thd                                                                                                                                                       
 37401 root      20   0 1725812 954204   3052 S  0.0  0.1   0:00.00 jemalloc_bg_thd                                                                                                                                                       
 37402 root      20   0 1725812 954204   3052 S  0.0  0.1   0:00.00 jemalloc_bg_thd 

测试结果

线程数 PING SET GET INCR LPUSH RPUSH RPOP SADD HSET LRANGE_600 MSET
1 58719 58139 58788 61614 57142 58207 58343 61199 60024 2257 42211
2 75585 90497 74738 90991 74682 75301 75131 92421 90744 4211 53792
4 126582 95328 96246 125470 94339 96432 95693 96339 95510 4559 64432
8 129701 97751 129198 129366 97751 97656 97751 129701 129198 4434 65445

image


对比silver 4216与 6150的绑核处理

线程数 PING SET GET INCR LPUSH SADD HSET LRANGE_600 MSET
鲲鹏920 8线程 129701 97751 129198 129366 97751 129701 129198 4434 65445
4216 8线程 130548 130718 130208 130208 130378 129870 130548 6069 78616
4216 8线程 绑核 130548 129701 130208 130718 130039 129701 130378 6826 78125

image


4216 的绑核处理

server_cpulist 0-8
bio_cpulist 9-10
aof_rewrite_cpulist 12-15
bgsave_cpulist 16-17

标签:20,0.1,3052,Redis,IO,954204,多线程,root,1725812
From: https://www.cnblogs.com/jinanxiaolaohu/p/17142203.html

相关文章