Redis性能测试
redis-benchmark -c 100 -n 20000 -t get,set -q --csv
-c代表客户端并发数量,默认是50
-n代表客户端请求总量,默认为100000
-q显示requests per second信息
-r SET/GET/INCR 使用随机 key, SADD 使用随机值
-t对指定命令进行基准测试
-d <size> Data size of SET/GET value in bytes (default 3)
--csv将结果按照csv格式输出
redis-benchmark -h 192.168.1.101 -p 6379 -r 100000 -n 100000 -q运行在安静的模式中,并且设置10万随机密钥
redis-benchmark -h 192.168.1.101 -p 6379 -c 100 -r 100000 -n 100000 -q模拟100个客户端
redis-benchmark -h 192.168.1.101 -p 6379 -c 10 -r 100000 -n 100000 -q模拟10个客户端
redis-benchmark -h 192.168.1.101 -p 6379 -r 100000 -n 100000 -P 16 -q流水线16条命令的测试
[root@mydb1 ~]# redis-benchmark -h 192.168.1.101 -p 6379 -c 10 -r 100000 -n 100000 -q
PING_INLINE: 72306.58 requests per second
PING_BULK: 71479.62 requests per second
SET: 75301.21 requests per second
GET: 71479.62 requests per second
INCR: 75700.23 requests per second
LPUSH: 74349.44 requests per second
RPUSH: 71275.84 requests per second
LPOP: 71890.73 requests per second
RPOP: 69783.67 requests per second
SADD: 68493.15 requests per second
HSET: 67750.68 requests per second
SPOP: 65789.48 requests per second
LPUSH (needed to benchmark LRANGE): 71479.62 requests per second
LRANGE_100 (first 100 elements): 72254.34 requests per second
LRANGE_300 (first 300 elements): 71684.59 requests per second
LRANGE_500 (first 450 elements): 71530.76 requests per second
LRANGE_600 (first 600 elements): 68306.01 requests per second
MSET (10 keys): 55493.89 requests per second