redis-benchmark 基础6

2022-04-25 00:14:41 浏览数 (1)

测试指定的命令

代码语言:javascript复制
[root@h102 src]# ./redis-benchmark -r 10000 -n 10000 eval 'return redis.call("ping")' 0
====== eval return redis.call("ping") 0 ======
  10000 requests completed in 0.28 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

30.19% <= 1 milliseconds
95.13% <= 2 milliseconds
98.26% <= 3 milliseconds
98.97% <= 4 milliseconds
99.51% <= 7 milliseconds
100.00% <= 7 milliseconds
36101.08 requests per second

[root@h102 src]# 

使用10000个随机元素填充一个列表

代码语言:javascript复制
[root@h102 src]# ./redis-benchmark -r 10000 -n 10000 lpush mylist __rand_int__
====== lpush mylist __rand_int__ ======
  10000 requests completed in 0.19 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

95.37% <= 1 milliseconds
98.58% <= 2 milliseconds
98.94% <= 3 milliseconds
99.08% <= 5 milliseconds
99.47% <= 6 milliseconds
99.51% <= 12 milliseconds
99.75% <= 13 milliseconds
100.00% <= 13 milliseconds
52910.05 requests per second

[root@h102 src]# 

命令汇总

  • wget http://download.redis.io/releases/redis-3.0.5.tar.gz
  • tar zxvf redis-3.0.5.tar.gz
  • cd redis-3.0.5
  • make
  • ./redis-benchmark -h
  • ./redis-benchmark
  • ./redis-benchmark -t set -r 100000 -n 1000000
  • ./redis-benchmark -n 1000000 -t set,get -P 16 -q
  • ./redis-benchmark -q
  • ./redis-benchmark -h localhost -p 6379 -n 100000 -c 20
  • ./redis-benchmark -t set -n 1000000 -r 100000000
  • ./redis-cli info | grep db0
  • ./redis-benchmark -t ping,set,get -n 100000 –csv
  • ./redis-benchmark -r 10000 -n 10000 eval ‘return redis.call(“ping”)’ 0
  • ./redis-benchmark -r 10000 -n 10000 lpush mylist __rand_int__

原文地址

0 人点赞