redis基准测试

Redis的基准是用来检查redis 的性能的工具。

redis-benchmark [option] [option value]
Redis的基准有许多可供选择,分列如下:

S.N. 选项 描述 默认值
1 -h 指定服务器的主机名 127.0.0.1
2 -p 指定服务器端口 6379
3 -s 指定服务器套接字  
4 -c 指定并行连接数 50
5 -n 指定请求总数 10000
6 -d 指定以字节为单位设置/获取值的数据大小 2
7 -k 1=保持活动0=重新连接 1
8 -r 使用随机键对SET/GET/INCR,随机SADD值  
9 -p 管道<numreq>请求 1
1 -h 指定服务器的主机名  
10 -q Redis强制安静操作。只显示查询/秒值  
11 --csv 输出为CSV格式  
12 -l 产生循环,永远运行测试  
13 -t 只有运行的逗号分隔的测试列表。  
14 -I 空闲模式。刚刚开N个空闲连接和等待。

// redis对50个并行连接的性能情况
[root@iZ23ogabm5zZ bin]# redis-benchmark -c 50
====== PING_INLINE ======
  100000 requests completed in 1.61 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.71% <= 1 milliseconds
100.00% <= 2 milliseconds
62189.05 requests per second

====== PING_BULK ======
  100000 requests completed in 1.62 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.46% <= 1 milliseconds
99.90% <= 2 milliseconds
99.95% <= 3 milliseconds
99.99% <= 4 milliseconds
100.00% <= 4 milliseconds
61804.70 requests per second

====== SET ======
  100000 requests completed in 1.53 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.85% <= 1 milliseconds
99.98% <= 2 milliseconds
100.00% <= 3 milliseconds
65189.05 requests per second

====== GET ======
  100000 requests completed in 1.55 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.59% <= 1 milliseconds
99.95% <= 3 milliseconds
100.00% <= 3 milliseconds
64308.68 requests per second

====== INCR ======
  100000 requests completed in 1.51 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.91% <= 1 milliseconds
100.00% <= 2 milliseconds
100.00% <= 2 milliseconds
66313.00 requests per second

====== LPUSH ======
  100000 requests completed in 1.50 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.71% <= 1 milliseconds
99.99% <= 2 milliseconds
100.00% <= 2 milliseconds
66577.90 requests per second

====== LPOP ======
  100000 requests completed in 1.50 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.72% <= 1 milliseconds
99.99% <= 2 milliseconds
100.00% <= 2 milliseconds
66489.36 requests per second

====== SADD ======
  100000 requests completed in 1.53 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.68% <= 1 milliseconds
100.00% <= 1 milliseconds
65274.15 requests per second

====== SPOP ======
  100000 requests completed in 1.50 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.88% <= 1 milliseconds
100.00% <= 1 milliseconds
66489.36 requests per second

====== LPUSH (needed to benchmark LRANGE) ======
  100000 requests completed in 1.54 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.72% <= 1 milliseconds
100.00% <= 1 milliseconds
64935.07 requests per second

====== LRANGE_100 (first 100 elements) ======
  100000 requests completed in 1.53 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.78% <= 1 milliseconds
99.97% <= 2 milliseconds
100.00% <= 2 milliseconds
65445.03 requests per second

====== LRANGE_300 (first 300 elements) ======
  100000 requests completed in 1.54 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.85% <= 1 milliseconds
100.00% <= 1 milliseconds
64935.07 requests per second

====== LRANGE_500 (first 450 elements) ======
  100000 requests completed in 1.53 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.82% <= 1 milliseconds
100.00% <= 2 milliseconds
65274.15 requests per second

====== LRANGE_600 (first 600 elements) ======
  100000 requests completed in 1.54 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.74% <= 1 milliseconds
100.00% <= 2 milliseconds
100.00% <= 2 milliseconds
64766.84 requests per second

====== MSET (10 keys) ======
  100000 requests completed in 1.73 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

92.32% <= 1 milliseconds
99.97% <= 2 milliseconds
100.00% <= 2 milliseconds
57670.12 requests per second


这个命令主要用于测试redis的性能瓶颈。

你可能感兴趣的:(redis基准)