美文网首页vanishalone
Redis性能测试redis-benchmark使用教程

Redis性能测试redis-benchmark使用教程

作者: 小丸子的呆地 | 来源:发表于2021-07-13 18:01 被阅读0次

Redis 自带了一个叫 redis-benchmark 的工具来模拟 N 个客户端同时发出 M 个请求。 (类似于 Apache ab 程序)。你可以使用 redis-benchmark -h 来查看基准参数。

Usage: redis-benchmark [-h <host>] [-p <port>] [-c <clients>] [-n <requests]> [-k <boolean>]

-h <hostname> Server hostname (default 127.0.0.1) 服务地址
-p <port> Server port (default 6379) 服务端口
-s <socket> Server socket (overrides host and port)
-a <password> Password for Redis Auth
-c <clients> Number of parallel connections (default 50) 并行客户端数量 默认50
-n <requests> Total number of requests (default 100000) 测试请求次数 默认100000
-d <size> Data size of SET/GET value in bytes (default 2) 数据包大小 默认2bytes
-dbnum <db> SELECT the specified db number (default 0)
-k <boolean> 1=keep alive 0=reconnect (default 1) 链接存活时间
-r <keyspacelen> Use random keys for SET/GET/INCR, random values for SADD
Using this option the benchmark will expand the string rand_int
inside an argument with a 12 digits number in the specified range
from 0 to keyspacelen-1. The substitution changes every time a command
is executed. Default tests use this to hit random keys in the
specified range.
-P <numreq> Pipeline <numreq> requests. Default 1 (no pipeline).
-q Quiet. Just show query/sec values
--csv Output in CSV format
-l Loop. Run the tests forever
-t <tests> Only run the comma separated list of tests. The test
names are the same as the ones produced as output.
-I Idle mode. Just open N idle connections and wait.

image.png

redis-benchmark -n 100000 -t GET,SET

====== SET ======
  100000 requests completed in 1.60 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1
  multi-thread: no

0.00% <= 0.2 milliseconds
4.91% <= 0.3 milliseconds
46.50% <= 0.4 milliseconds
74.06% <= 0.5 milliseconds
85.52% <= 0.6 milliseconds
90.30% <= 0.7 milliseconds
92.95% <= 0.8 milliseconds
94.85% <= 0.9 milliseconds
96.10% <= 1.0 milliseconds
96.97% <= 1.1 milliseconds
97.56% <= 1.2 milliseconds
97.99% <= 1.3 milliseconds
98.31% <= 1.4 milliseconds
98.55% <= 1.5 milliseconds
98.72% <= 1.6 milliseconds
98.85% <= 1.7 milliseconds
98.96% <= 1.8 milliseconds
99.04% <= 1.9 milliseconds
99.11% <= 2 milliseconds
99.66% <= 3 milliseconds
99.87% <= 4 milliseconds
99.92% <= 5 milliseconds
99.93% <= 6 milliseconds
99.97% <= 7 milliseconds
100.00% <= 8 milliseconds
100.00% <= 8 milliseconds
62421.97 requests per second

====== GET ======
  100000 requests completed in 1.70 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1
  multi-thread: no

94.45% <= 1 milliseconds
98.95% <= 2 milliseconds
99.45% <= 3 milliseconds
99.75% <= 4 milliseconds
99.82% <= 5 milliseconds
99.83% <= 6 milliseconds
99.84% <= 7 milliseconds
99.87% <= 8 milliseconds
99.96% <= 9 milliseconds
99.98% <= 10 milliseconds
99.99% <= 11 milliseconds
99.99% <= 15 milliseconds
99.99% <= 16 milliseconds
100.00% <= 17 milliseconds
100.00% <= 18 milliseconds
58719.91 requests per second

相关文章

  • redis 性能测试

    1、使用redis-benchmark工具 redis-benchmark 工具是 redis 自带性能测试工具,...

  • Redis性能测试redis-benchmark使用教程

    Redis 自带了一个叫 redis-benchmark 的工具来模拟 N 个客户端同时发出 M 个请求。 (类似...

  • Redis_测试性能

    redis-benchmark是一个压力测试工具,官方自带的性能测试工具!redis性能测试工具可选参数如下所示:...

  • Redis 性能测试

    本文使用 redis 自带的 redis-benchmark 工具进行压力测试 参数说明 命令格式如下: 参数说明...

  • Tips Book

    redis可以使用redis-benchmark命令进行压力测试。常用命令参数有 -h : host -p : p...

  • Redis-性能测试

    /root/redis-5.0.0/src/redis-benchmark 1、redis-benchmark -...

  • redis压测

    1.使用redis自带的压测 redis中src目录下 ./redis-benchmark -h 192.168....

  • redis基础知识

    一、redis-benchmark redis自带的压力测试工具! 如果按照默认路径安装,该工具安装在路径/...

  • Redis管道技术的使用

    目录 Redis 管道技术 SpringDataRedis 使用管道 Redis 管道的性能测试 使用管道技术的注...

  • Redis的性能测试与基本知识

    性能测试 启动redis服务器(基于自己的配置文件启动) 使用redis自带的性能测试工具测试并发性 基础知识 R...

网友评论

    本文标题:Redis性能测试redis-benchmark使用教程

    本文链接:https://www.haomeiwen.com/subject/azespltx.html