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 的性能幻想与残酷现实

    2011 年,当初选择 Redis 作为主要的内存数据存储,主要吸引我的是它提供多样的基础数据结构可以很方便的实现业务需求.另一方面又比较担心它的性能是否足以支撑,毕竟当时 Redis 还属于比较新的 ...

  3. 转载----How fast is Redis?

    How fast is Redis? Redis includes the redis-benchmark utility that simulates running commands done b ...

  4. benchmark

    redis benchmark How many requests per second can I get out of Redis? Using New Relic to Understand R ...

  5. Redis 的性能幻想与残酷现实(转)

    2011 年,当初选择 Redis 作为主要的内存数据存储,主要吸引我的是它提供多样的基础数据结构可以很方便的实现业务需求.另一方面又比较担心它的性能是否足以支撑,毕竟当时 Redis 还属于比较新的 ...

  6. Redis 的性能

    Redis 的性能幻想与残酷现实 2011 年,当初选择 Redis 作为主要的内存数据存储,主要吸引我的是它提供多样的基础数据结构可以很方便的实现业务需求.另一方面又比较担心它的性能是否足以支撑,毕 ...

  7. Redis 性能问题的记录

    最近线上使用redis, 查询的情况不甚理想, 这个查询操作是个 lua 脚本, 包含如下操作 开发机 redis, 没有其他干扰, 插入的 zset 有 5000 member 左右, 使用的 re ...

  8. 深入redis内部---网络编程

    Redis在anet.h和anet.c中封装了底层套接字实现: 1.anetTcpServer,建立网络套接字服务器,完成对socket(),bind(),listen()等操作的封装,返回socke ...

  9. Redis集群生产环境源码安装

    安装redis集群  根据各人单位生产环境用户搭建一.安装环境    操作系统:centos7.6 关闭防火墙.关闭selinux redis1:192.168.26.128 redis2:192.1 ...

  10. Redis 6.0 新特性-多线程连环13问!

    Redis 6.0 来了 在全国一片祥和IT民工欢度五一节假日的时候,Redis 6.0不声不响地于5 月 2 日正式发布了,吓得我赶紧从床上爬起来,学无止境!学无止境! 对于6.0版本,Redis之 ...

随机推荐

  1. git入门三(远程、标签)

    git 入门三 (远程.标签)     分布式版本控制管理系统本地仓库和中心服务器仓库数据是本地的镜像仓库,中心服务器数据仓库的是为了多用户数据合并和获取同步的中心,多人协作需要管理这些远程仓库,以便 ...

  2. java 经典范例

    使用for 循环输出空心菱形 package 开阳; import java.util.Scanner; public class image { public static void main(St ...

  3. 为什么是kafka(二)

    回答几个网友提出的问题,不清楚的能够看上一篇内容. 1.  kafka的删除策略应该怎么配置?为了提升性能.我是不是应该1小时删除一次消费过的数据. 全然能够依据磁盘大小配置.仅仅要磁盘足够用,全然不 ...

  4. 批量删除redis某个键值

    /usr/local/redis/src/redis-cli -h 172.28.6.23  -p 6383 keys "virtual*" |xargs /usr/local/r ...

  5. 【BZOJ4548】小奇的糖果 set(链表)+树状数组

    [BZOJ4548]小奇的糖果 Description 有 N 个彩色糖果在平面上.小奇想在平面上取一条水平的线段,并拾起它上方或下方的所有糖果.求出最多能够拾起多少糖果,使得获得的糖果并不包含所有的 ...

  6. sharding-jdbc从入门到出门(03)

    经过端午节这2天对 sharding-jdbc一直怀揣成梦想的去学习,还是有一些没有解决的问题: 上一张图:

  7. mybatis generator的用法

    1 自动生成代码 配置数据库 自动生成三个文件: 第一,java bean文件: 第二,java bean对应的dao文件,但是这里的dao只是一个接口: 第三,mybatis需要的Mapper文件: ...

  8. sql 2008数据事务日志已满处理方法

    突然发现sql 2008出现错误:数据库 'mybase_db' 的事务日志已满.若要查明无法重用日志中的空间的原因,请参阅 sys.databases 中的 log_reuse_wait_desc ...

  9. memcpy使用

    void memcpy(void dest, const void *src, size_t n); 功能编辑 从源src所指的内存地址的起始位置开始拷贝n个字节到目标dest所指的内存地址的起始位置 ...

  10. 数据库连接理解——JDBC

    需求:数据库操作 数据是:用户信息 1.连接数据库  JDBC Hibernate 2.操作数据库 c create r read u update d delete 3.关闭数据库连接 interf ...