分布式缓存Redis之性能测试

版权声明:感谢来访!欢迎指导、勘误、讨论及转载,转载请注明出处 https://blog.csdn.net/u011489043/article/details/78884075

写在前面

  本学习教程所有示例代码见GitHub:https://github.com/selfconzrr/Redis_Learning

  Redis 性能测试是通过同时执行多个命令实现的。

语法:

  redis 性能测试的基本命令如下:

redis-benchmark [option] [option value]

实例

  以下实例同时执行 10000 个请求来检测性能:

redis-benchmark -n 100000

PING_INLINE: 141043.72 requests per second
PING_BULK: 142857.14 requests per second
SET: 141442.72 requests per second
GET: 145348.83 requests per second
INCR: 137362.64 requests per second
LPUSH: 145348.83 requests per second
LPOP: 146198.83 requests per second
SADD: 146198.83 requests per second
SPOP: 149253.73 requests per second
LPUSH (needed to benchmark LRANGE): 148588.42 requests per second
LRANGE_100 (first 100 elements): 58411.21 requests per second
LRANGE_300 (first 300 elements): 21195.42 requests per second
LRANGE_500 (first 450 elements): 14539.11 requests per second
LRANGE_600 (first 600 elements): 10504.20 requests per second
MSET (10 keys): 93283.58 requests per second

  redis 性能测试工具可选参数如下所示:

  这里写图片描述

实例

  以下实例我们使用了多个参数来测试 redis 性能:

redis-benchmark -h 127.0.0.1 -p 6379 -t set,lpush -n 100000 -q 

  SET: 146198.83 requests per second
  LPUSH: 145560.41 requests per second

  以上实例中主机为 127.0.0.1,端口号为 6379,执行的命令为 set,lpush,请求数为 10000,通过 -q 参数让结果只显示每秒执行的请求数。

—–乐于分享,共同进步
—–Any comments greatly appreciated
—–诚心欢迎各位交流讨论!QQ:1138517609

猜你喜欢

转载自blog.csdn.net/u011489043/article/details/78884075