官方自带的压力测试工具,参数如下:
在benchmark所在目录执行命令
./redis-benchmark -h 127.0.0.1 -p 6379 -a 123456 -c 100 -n 100000
压测需要一段时间,因为它需要依次压测多个命令的结果,如:get、set、incr、lpush等,如果只需要看一部分的,可以直接暂停。
[linkdo@VM-0-7-centos bin]$ ./redis-benchmark -h 127.0.0.1 -p 6379 -a 123456 -c 100 -n 100000 ====== PING_INLINE ====== 100000 requests completed in 1.39 seconds 100 parallel clients 3 bytes payload keep alive: 1 56.66% <= 1 milliseconds 98.52% <= 2 milliseconds 99.38% <= 3 milliseconds 100.00% <= 3 milliseconds 72150.07 requests per second ====== PING_BULK ====== 100000 requests completed in 1.41 seconds 100 parallel clients 3 bytes payload keep alive: 1 59.71% <= 1 milliseconds 96.74% <= 2 milliseconds 98.23% <= 3 milliseconds 99.34% <= 4 milliseconds 99.54% <= 5 milliseconds 99.64% <= 6 milliseconds 99.80% <= 9 milliseconds 99.94% <= 10 milliseconds 100.00% <= 10 milliseconds 70721.36 requests per second ====== SET ====== 100000 requests completed in 1.39 seconds 100 parallel clients 3 bytes payload keep alive: 1 57.24% <= 1 milliseconds 98.12% <= 2 milliseconds 99.07% <= 3 milliseconds 99.79% <= 4 milliseconds 100.00% <= 4 milliseconds