从本篇文章·开始,博主将开始对redis的探索,今天的咱们先来聊聊benchmark性能测试工具,通过此工具来检查以下redis的读写能能力以及环境问题。通过此工具可以让我们更清楚的认识到redis具有怎样的能力,是否要进行其他的配置例如:服务器等。可以更好的处理数据的读写能力。
语法格式
redis-benchmark [参数] [参数值]
位置:位于bin文件下,在生成的bin文件中
模拟性能测试:
指定100000请求数,100 并发连接数
命令
./redis-benchmark -h localhost -p 6379 -c 100 -n 100000
执行命令
关于返回值进行讲解
===== PING_INLINE ======
100000 requests completed in 1.49 seconds 100000请求需要的时间
100 parallel clients 100并发数量
3 bytes payload 每次写入3个字节数
keep alive: 1 1个服务器
host configuration "save": 3600 1 300 100 60 10000 持久化方式默认开启的规则
host configuration "appendonly": no AOF持久化方式未开启
multi-thread: no 多线程未开启下面则是执行该测试需要的时间才能够完成
0.000% <= 0.591 milliseconds (cumulative count 6)
50.000% <= 1.055 milliseconds (cumulative count 50009)
75.000% <= 1.271 milliseconds (cumulative count 75671)
87.500% <= 1.375 milliseconds (cumulative count 88120)
93.750% <= 1.431 milliseconds (cumulative count 94440)
96.875% <= 1.479 milliseconds (cumulative count 96998)
98.438% <= 1.583 milliseconds (cumulative count 98470)
99.219% <= 1.703 milliseconds (cumulative count 99241)
99.609% <= 1.975 milliseconds (cumulative count 99614)
99.805% <= 2.391 milliseconds (cumulative count 99805)
99.902% <= 2.719 milliseconds (cumulative count 99903)
99.951% <= 2.959 milliseconds (cumulative count 99952)
99.976% <= 3.119 milliseconds (cumulative count 99976)
99.988% <= 3.231 milliseconds (cumulative count 99988)
99.994% <= 3.311 milliseconds (cumulative count 99994)
99.997% <= 3.343 milliseconds (cumulative count 99997)
99.998% <= 3.375 milliseconds (cumulative count 99999)
99.999% <= 3.399 milliseconds (cumulative count 100000)
100.000% <= 3.399 milliseconds (cumulative count 100000)