• redis-运维-性能测试


    简单使用

    liqiangdeMacBook-Pro:rediscluster liqiang$ redis-benchmark -h 127.0.0.1 -p 6379  -c 1 -q //1个客户端进行测试 -q简化输出
    #各个命令的tps测试 PING_INLINE:
    31357.79 requests per second PING_BULK: 32020.49 requests per second SET: 21017.23 requests per second GET: 31645.57 requests per second INCR: 21335.61 requests per second LPUSH: 20686.80 requests per second RPUSH: 20644.10 requests per second LPOP: 20924.88 requests per second RPOP: 21110.41 requests per second SADD: 30940.59 requests per second HSET: 20255.22 requests per second SPOP: 30826.14 requests per second LPUSH (needed to benchmark LRANGE): 20052.13 requests per second LRANGE_100 (first 100 elements): 15260.19 requests per second LRANGE_300 (first 300 elements): 8010.90 requests per second LRANGE_500 (first 450 elements): 6196.17 requests per second LRANGE_600 (first 600 elements): 4443.06 requests per second MSET (10 keys): 16134.24 requests per second

    只执行某些测试用例

    -t指定 执行哪些用例

    liqiangdeMacBook-Pro:rediscluster liqiang$ redis-benchmark -h 127.0.0.1 -p 6379  -c 1 -q -t set,lpush
    SET: 20964.36 requests per second
    LPUSH: 20618.56 requests per second

    直接指定命令

    liqiangdeMacBook-Pro:rediscluster liqiang$ redis-benchmark -h 127.0.0.1 -p 6379  -c 1 -q script load "redis.call('set','foo','bar')"
    script load redis.call('set','foo','bar'): 20811.65 requests per second

    不同key测试

    -r 多少个随机key  -n为set多少次 -t为只测set

    liqiangdeMacBook-Pro:rediscluster liqiang$ redis-benchmark -h 127.0.0.1 -p 6379  -c 1 -r 10000 -n 100000 -t SET
    ====== SET ======
      100000 requests completed in 4.78 seconds
      1 parallel clients
      3 bytes payload
      keep alive: 1
    
    100.00% <= 4 milliseconds
    100.00% <= 11 milliseconds
    100.00% <= 11 milliseconds
    20903.01 requests per second

    pipelining测试

    -p 表示使用pipelining 1000条为一组测试

    liqiangdeMacBook-Pro:rediscluster liqiang$ redis-benchmark -h 127.0.0.1 -p 6379  -c 1 -t set,get -P 1000 -q
    SET: 473933.66 requests per second
    GET: 1219512.12 requests per second
  • 相关阅读:
    图片展示,带分页
    miniui动态合并datagrid列
    使用webcam和video插件/华为云播放插件,实现视频播放及拍照上传功能
    Java实现excel导出(内容循环多个)
    C# 图片与Base64互转
    C#中将字符串转成 Base64 编码 (加密--解密)
    ASP.NET导出Excel之二
    利用Aspose转PDF
    ASP.NET视频播放
    Oracle存储过程导入,判断已有数据更新,没有的数据导入,统计导入成功与失败数,返回一个表
  • 原文地址:https://www.cnblogs.com/LQBlog/p/13323037.html
Copyright © 2020-2023  润新知