转载自http://blog.csdn.net/jiangguilong2000/article/details/24143721

Redis-benchmark为Redis性能测试工具。

指令说明:

  1. Usage: redis-benchmark [-h <host>] [-p <port>] [-c <clients>] [-n <requests]> [-k <boolean>]
  2. -h <hostname>      Server hostname (default 127.0.0.1)
  3. -p <port>          Server port (default 6379)
  4. -s <socket>        Server socket (overrides host and port)
  5. -c <clients>       Number of parallel connections (default 50)
  6. -n <requests>      Total number of requests (default 10000)
  7. -d <size>          Data size of SET/GET value in bytes (default 2)
  8. -k <boolean>       1=keep alive 0=reconnect (default 1)
  9. -r <keyspacelen>   Use random keys for SET/GET/INCR, random values for SADD
  10. Using this option the benchmark will get/set keys
  11. in the form mykey_rand:000000012456 instead of constant
  12. keys, the <keyspacelen> argument determines the max
  13. number of values for the random number. For instance
  14. if set to 10 only rand:000000000000 - rand:000000000009
  15. range will be allowed.
  16. -P <numreq>        Pipeline <numreq> requests. Default 1 (no pipeline).
  17. -q                 Quiet. Just show query/sec values 只显示每秒钟能处理多少请求数结果
  18. --csv              Output in CSV format
  19. -l                 Loop. Run the tests forever 永久测试
  20. -t <tests>         Only run the comma separated list of tests. The test
  21. names are the same as the ones produced as output.
  22. -I                 Idle mode. Just open N idle connections and wait.

实例:

redis-benchmark -h 127.0.0.1 -p 6379 -q -d 100  
SET/GET 100 bytes 检测host为127.0.0.1 端口为6379的redis服务器性能

redis-benchmark -h 127.0.0.1 -p 6379 -c 5000 -n 100000 
5000个并发连接,100000个请求,检测host为127.0.0.1 端口为6379的redis服务器性能

benchmark工具测试信息:
测试命令:
redis-benchmark -n 100000 -c 60
向redis服务器发送100000个请求,每个请求附带60个并发客户端
结果(部分):
====== SET ======
对集合写入测试
  100000 requests completed in 2.38 seconds
100000个请求在2.38秒内完成
  60 parallel clients
每次请求有60个并发客户端
  3 bytes payload
每次写入3个字节的数据
  keep alive: 1
保持一个连接,一台服务器来处理这些请求

93.06% <= 15 milliseconds
99.96% <= 31 milliseconds
99.98% <= 46 milliseconds
99.99% <= 62 milliseconds
100.00% <= 62 milliseconds
所有请求在62毫秒内完成
42105.26 requests per second
每秒处理42105.26次请求

  1. [root@localhost ~]# redis-benchmark -h 127.0.0.1 -p 6379 -c 5000 -n 100000  -d 100 -q
  2. PING_INLINE: 34506.55 requests per second
  3. PING_BULK: 34059.95 requests per second
  4. SET: 31959.09 requests per second
  5. GET: 31466.33 requests per second
  6. INCR: 33311.12 requests per second
  7. LPUSH: 29265.44 requests per second
  8. LPOP: 36968.58 requests per second
  9. SADD: 32030.75 requests per second
  10. SPOP: 33344.45 requests per second
  11. LPUSH (needed to benchmark LRANGE): 29735.36 requests per second
  12. LRANGE_100 (first 100 elements): 16116.04 requests per second
  13. LRANGE_300 (first 300 elements): 6659.56 requests per second
  14. LRANGE_500 (first 450 elements): 4108.29 requests per second

[转载] Redis-benchmark使用总结的更多相关文章

  1. Azure Redis Cache (3) 在Windows 环境下使用Redis Benchmark

    <Windows Azure Platform 系列文章目录> 熟悉Redis环境的读者都知道,我们可以在Linux环境里,使用Redis Benchmark,测试Redis的性能. ht ...

  2. [转载] Redis 起步

    转载地址:http://www.cnblogs.com/shanyou/archive/2012/01/28/2330451.html Rdis和JQuery一样是纯粹为应用而产生的,这里记录的是在C ...

  3. [转载] Redis快速入门

    转载自http://www.yiibai.com/redis/redis_quick_guide.html Redis是一个开源,先进的key-value存储,并用于构建高性能,可扩展的Web应用程序 ...

  4. [转载] Redis

    转载:http://snowolf.iteye.com/blog/1630697 大约一年多前,公司同事开始使用Redis,不清楚是配置,还是版本的问题,当时的Redis经常在使用一段时间后,连接爆满 ...

  5. [转载] redis 的两种持久化方式及原理

    转载自http://www.m690.com/archives/371 Redis是一种高级key-value数据库.它跟memcached类似,不过数据可以持久化,而且支持的数据类型很丰富.有字符串 ...

  6. [转载] Redis集群搭建最佳实践

    转载自http://blog.csdn.net/sweetvvck/article/details/38315149?utm_source=tuicool 要搭建Redis集群,首先得考虑下面的几个问 ...

  7. [转载] Redis资料汇总专题

    转载自http://www.cnblogs.com/tommyli/archive/2011/12/14/2287614.html 1.Redis是什么? 十五分钟介绍 Redis数据结构 Redis ...

  8. [转载] Redis系统性介绍

    转载自http://blog.nosqlfan.com/html/3139.html?ref=rediszt 虽然Redis已经很火了,相信还是有很多同学对Redis只是有所听闻或者了解并不全面,下面 ...

  9. [转载] Redis之七种武器

    转载自http://blog.nosqlfan.com/html/2942.html?ref=rediszt 长生剑.孔雀翎.碧玉刀.多情环.离别钩.霸王枪.拳头是古龙笔下的七种武器,而本文打算将Re ...

  10. [转载] Redis实现分布式锁

    转载自http://zhidao.baidu.com/link?url=m56mmWYwRgCymsaLZ2tx-GWDy5FYmUWGovEtuApjTpktHS3bhofrCS-QVGiLoWeS ...

随机推荐

  1. IPSec协议

    IPSec协议:IPsec将IP数据包的内容先加密再传输,即便中途被截获,由于缺乏解密数据包所必要的密钥,攻击者也无法获取里面的内容. 传输模式和隧道模式:IPsec对数据进行加密的方式有两种:传输模 ...

  2. asp.net或者MVC定时自动执行某操作

    using System; using System.IO; using System.Runtime.CompilerServices; using System.Text; namespace S ...

  3. win10 uwp 装机必备应用 含源代码

    zhxilin大神说http://www.cnblogs.com/zhxilin/p/4819372.html这文章说到了使用await Windows.System.Launcher.LaunchU ...

  4. 【网络爬虫入门04】彻底掌握BeautifulSoup的CSS选择器

    [网络爬虫入门04]彻底掌握BeautifulSoup的CSS选择器 广东职业技术学院  欧浩源 2017-10-21 1.引言 目前,除了官方文档之外,市面上及网络详细介绍BeautifulSoup ...

  5. PHP开发者必须了解的9个魔术方法

    这些'魔术'方法拥有者特殊的名字,以两个下划线开始,表示这些方法在PHP特定事件下将会被触发.这可能听起来有点自动魔法但是它真的很酷的,我们已经看过一个简单的例子在 last post,即我们使用一个 ...

  6. 我的第一个python web开发框架(10)——工具函数包说明(一)

    PS:原先是想直接进入功能开发,要用到什么函数时再创建,这样也容易熟悉每个函数的由来和使用方法,但考虑到这样操作,到时会经常在不同文件间切换,不好描述,容易造成混乱,所以还是使用函数库这种方式来说明. ...

  7. 转 node.js里面的http模块深入理解

    问题1:HTTP服务继承了TCP服务模型,是从connection为单位的服务到以request为单位的服务的封装,那么request事件何时触发? 注意:在开启keepalive后,一个TCP会话可 ...

  8. LeetCode 599. Minimum Index Sum of Two Lists (从两个lists里找到相同的并且位置总和最靠前的)

    Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite ...

  9. css中居中方法小结

    ---恢复内容开始--- 1.文字垂直居中 .header_nav-item{ height:38px; line-height:38px; } 即文字所在模块的高度和行高设置成一样的! 2.块元素垂 ...

  10. VUE 源码学习01 源码入口

    VUE[version:2.4.1] Vue项目做了不少,最近在学习设计模式与Vue源码,记录一下自己的脚印!共勉!注:此处源码学习方式为先了解其大模块,从宏观再去到微观学习,以免一开始就研究细节然后 ...