51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1538|回复: 1
打印 上一主题 下一主题

同时执行多个命令的Redis性能测试到底多简单

[复制链接]
  • TA的每日心情
    无聊
    3 天前
  • 签到天数: 523 天

    连续签到: 5 天

    [LV.9]测试副司令

    跳转到指定楼层
    1#
    发表于 2020-9-23 10:58:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
     一、服务器环境

    二、Redis 之 redis-benchmark
      redis 提供了 redis-benchmark 工具便于我们做[url=]性能测试[/url],可以使用 redis-benchmark- h 查看参数。


    三、Docker Redis测试
      单并发测试
      测试命令

    1. ./redis-benchmark -c 1 -n 20000 -d 30720 -t set,get
    复制代码
    测试结果每秒是 8000+的QPS
      多并发测试
      假设 10并发,20000个请求,每次请求数据包大小为 30KB,只进行set和get测试。

    1.  ./redis-benchmark -c 10 -n 20000 -d 30720 -t set,get
    复制代码
    1. ====== SET ======

    2.     20000 requests completed in 1.06 seconds

    3.     10 parallel clients

    4.     30720 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   0.00% <= 0.1 milliseconds

    10.   0.12% <= 0.2 milliseconds

    11.   96.42% <= 0.3 milliseconds

    12.   99.69% <= 0.4 milliseconds

    13.   99.79% <= 0.5 milliseconds

    14.   99.84% <= 0.6 milliseconds

    15.   99.86% <= 0.7 milliseconds

    16.   99.88% <= 0.8 milliseconds

    17.   99.89% <= 0.9 milliseconds

    18.   99.90% <= 1.1 milliseconds

    19.   99.93% <= 3 milliseconds

    20.   99.96% <= 141 milliseconds

    21.   99.97% <= 142 milliseconds

    22.   100.00% <= 142 milliseconds

    23.   18903.59 requests per second
    复制代码
    1. ====== GET ======

    2.     20000 requests completed in 1.30 seconds

    3.     10 parallel clients

    4.     30720 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   100.00% <= 0 milliseconds

    10.   15360.98 requests per second
    复制代码
    可以看到 set 每秒可以处理 18903.59 个请求,get 可以处理 15360.98 个请求。
      接下来测试 -P 命令
      20000个请求,每次请求数据包大小为 30KB,只进行set和get测试。

    1. ./redis-benchmark -n 20000  -P 10 -d 30720 -t set,get
    复制代码
    1.  ====== SET ======

    2.     20007 requests completed in 0.47 seconds

    3.     50 parallel clients

    4.     30720 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   0.00% <= 0.9 milliseconds

    10.   0.16% <= 1.0 milliseconds

    11.   2.28% <= 1.1 milliseconds

    12.   12.84% <= 1.2 milliseconds

    13.   27.49% <= 1.3 milliseconds

    14.   52.28% <= 1.4 milliseconds

    15.   78.03% <= 1.5 milliseconds

    16.   89.83% <= 1.6 milliseconds

    17.   93.50% <= 1.7 milliseconds

    18.   94.75% <= 1.8 milliseconds

    19.   95.25% <= 1.9 milliseconds

    20.   95.65% <= 2 milliseconds

    21.   96.86% <= 3 milliseconds

    22.   97.40% <= 4 milliseconds

    23.   97.96% <= 5 milliseconds

    24.   98.25% <= 6 milliseconds

    25.   98.56% <= 7 milliseconds

    26.   99.15% <= 8 milliseconds

    27.   99.46% <= 9 milliseconds

    28.   99.65% <= 10 milliseconds

    29.   100.00% <= 10 milliseconds

    30.   42933.48 requests per second
    复制代码
    1. ====== GET ======

    2.     20002 requests completed in 0.44 seconds

    3.     50 parallel clients

    4.     30720 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   0.00% <= 1 milliseconds

    10.   0.31% <= 2 milliseconds

    11.   25.25% <= 3 milliseconds

    12.   65.50% <= 4 milliseconds

    13.   89.46% <= 5 milliseconds

    14.   96.71% <= 6 milliseconds

    15.   97.50% <= 8 milliseconds

    16.   97.75% <= 9 milliseconds

    17.   98.31% <= 10 milliseconds

    18.   98.81% <= 11 milliseconds

    19.   99.25% <= 13 milliseconds

    20.   99.61% <= 14 milliseconds

    21.   100.00% <= 14 milliseconds

    22.   45253.39 requests per second
    复制代码
    四、redis6 安装版测试
    1.  单并发测试  ./redis-benchmark --dbnum 1 -t set,get -c 1 -n 200000
    复制代码
    1. ====== SET ======

    2.     200000 requests completed in 20.20 seconds

    3.     1 parallel clients

    4.     3 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   88.49% <= 0.1 milliseconds

    10.   99.98% <= 0.2 milliseconds

    11.   99.99% <= 0.3 milliseconds

    12.   100.00% <= 0.4 milliseconds

    13.   9900.01 requests per second
    复制代码
    1. ====== GET ======

    2.     200000 requests completed in 20.01 seconds

    3.     1 parallel clients

    4.     3 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   88.37% <= 0.1 milliseconds

    10.   99.99% <= 0.2 milliseconds

    11.   99.99% <= 0.3 milliseconds

    12.   100.00% <= 0.4 milliseconds

    13.   9995.50 requests per second
    复制代码
    多并发测试
      测试命令

    1.  ./redis-benchmark --dbnum 1 -t set,get -c 10 -n 200000
    复制代码
    1. ====== SET ======

    2.     200000 requests completed in 3.00 seconds

    3.     10 parallel clients

    4.     3 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   73.58% <= 0.1 milliseconds

    10.   99.72% <= 0.2 milliseconds

    11.   99.90% <= 0.3 milliseconds

    12.   99.93% <= 0.4 milliseconds

    13.   99.96% <= 0.5 milliseconds

    14.   99.98% <= 0.6 milliseconds

    15.   99.98% <= 0.8 milliseconds

    16.   99.99% <= 0.9 milliseconds

    17.   99.99% <= 1.2 milliseconds

    18.   99.99% <= 1.3 milliseconds

    19.   99.99% <= 1.4 milliseconds

    20.   100.00% <= 1.6 milliseconds

    21.   100.00% <= 2 milliseconds

    22.   100.00% <= 2 milliseconds

    23.   66622.25 requests per second
    复制代码
    1.  ====== GET ======

    2.     200000 requests completed in 3.02 seconds

    3.     10 parallel clients

    4.     3 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   100.00% <= 1 milliseconds

    10.   100.00% <= 1 milliseconds

    11.   66137.57 requests per second
    复制代码
    -P 测试
      单并发测试

    1. ./redis-benchmark --dbnum 1 -t set,get -c 1 -n 200000 -P 10
    复制代码
    1. ====== SET ======

    2.     200000 requests completed in 2.20 seconds

    3.     1 parallel clients

    4.     3 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   72.01% <= 0.1 milliseconds

    10.   99.98% <= 0.2 milliseconds

    11.   100.00% <= 0.3 milliseconds

    12.   100.00% <= 0.3 milliseconds

    13.   90991.81 requests per second
    复制代码
    1. ====== GET ======

    2.     200000 requests completed in 2.15 seconds

    3.     1 parallel clients

    4.     3 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   81.53% <= 0.1 milliseconds

    10.   99.99% <= 0.2 milliseconds

    11.   100.00% <= 0.3 milliseconds

    12.   100.00% <= 0.3 milliseconds

    13.   92980.01 requests per second
    复制代码
    多并发测试
    1.  ./redis-benchmark --dbnum 1 -t set,get -c 10 -n 200000 -P 10
    复制代码
    1. ====== SET ======

    2.     200010 requests completed in 0.42 seconds

    3.     10 parallel clients

    4.     3 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   3.15% <= 0.1 milliseconds

    10.   67.35% <= 0.2 milliseconds

    11.   99.33% <= 0.3 milliseconds

    12.   99.66% <= 0.4 milliseconds

    13.   99.88% <= 0.5 milliseconds

    14.   99.92% <= 0.6 milliseconds

    15.   99.92% <= 0.9 milliseconds

    16.   99.94% <= 1.0 milliseconds

    17.   99.95% <= 2 milliseconds

    18.   99.98% <= 3 milliseconds

    19.   100.00% <= 3 milliseconds

    20.   480793.25 requests per second
    复制代码
    1. ====== GET ======

    2.     200000 requests completed in 0.34 seconds

    3.     10 parallel clients

    4.     3 bytes payload

    5.     keep alive: 1

    6.     host configuration "save": 900 1 300 10 60 10000

    7.     host configuration "appendonly": no

    8.     multi-thread: no




    9.   100.00% <= 0 milliseconds

    10.   586510.25 requests per second
    复制代码


    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

    x
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-11 16:13 , Processed in 0.063032 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表