zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    [Jenkins]admin用户登陆,提示登陆无效(之前登陆OK,三天没有登陆,突然提示登陆无效,重启无法解决)的解决方法
    科普技术贴:个人开发者的那些赚钱方式
    赚钱必看:独立开发者必知的一些总结
    【转】微信小程序给程序员带来的可能是一个赚钱的机遇
    20个编写现代 CSS 代码的建议
    Python爬虫入门一之综述
    Python学习基础知识概要
    文本框输入邮箱自动联想补全
    鼠标移到图片放大效果
    网站banner无缝轮播
  • 原文地址:https://www.cnblogs.com/LQBlog/p/13323037.html
Copyright © 2011-2022 走看看