我们在Redis的安装目录的bin目录下可以看到
这里用redis-benchmark来进行测试
相关参数:
测试案例:
redis-benchmark -h localhost -p 6397 -c 100 -n 100000
====== PING_INLINE ======
100000 requests completed in 1.10 seconds
100 parallel clients
3 bytes payload
keep alive: 1
83.78% <= 1 milliseconds
99.76% <= 2 milliseconds
100.00% <= 2 milliseconds
90744.10 requests per second
====== PING_BULK ======
100000 requests completed in 1.05 seconds
100 parallel clients
3 bytes payload
keep alive: 1
89.21% <= 1 milliseconds
99.75% <= 2 milliseconds
100.00% <= 2 milliseconds
95057.03 requests per second
====== SET ======
100000 requests completed in 1.12 seconds # 10万次请求进行 SET 操作,用时1.12秒
100 parallel clients # 100 个并发客户端
3 bytes payload # 每次写入3个字节
keep alive: 1 # 只有一台服务器来处理请求,单机测试
83.46% <= 1 milliseconds
98.97% <= 2 milliseconds
99.86% <= 3 milliseconds
99.91% <= 4 milliseconds
100.00% <= 4 milliseconds # 100%的请求在4毫秒内处理完成
88967.98 requests per second # 平均每秒处理88967.98次请求
====== GET ======
100000 requests completed in 1.05 seconds
100 parallel clients
3 bytes payload
keep alive: 1
90.31% <= 1 milliseconds
99.57% <= 2 milliseconds
99.96% <= 3 milliseconds
100.00% <= 3 milliseconds
94786.73 requests per second