Redis压测

Redis压测

-c:模拟100并发 -n:100000请求 默认3字节

➜  ~ git:(master) ✗ redis-benchmark -h 127.0.0.1 -p 6379 -c 100 -n 100000

 

== SADD ==   100000 requests completed in 1.98 seconds   100 parallel clients   3 bytes payload   keep alive: 1

43.10% <= 1 milliseconds 89.74% <= 2 milliseconds 96.60% <= 3 milliseconds 99.00% <= 4 milliseconds 99.50% <= 5 milliseconds 99.72% <= 6 milliseconds 99.86% <= 7 milliseconds 99.94% <= 8 milliseconds 99.97% <= 9 milliseconds 100.00% <= 9 milliseconds 50556.12 requests per second

== HSET ==   100000 requests completed in 2.31 seconds   100 parallel clients   3 bytes payload   keep alive: 1

43.60% <= 1 milliseconds 87.32% <= 2 milliseconds 95.20% <= 3 milliseconds 98.15% <= 4 milliseconds 99.13% <= 5 milliseconds 99.56% <= 6 milliseconds 99.74% <= 7 milliseconds 99.82% <= 8 milliseconds 99.90% <= 9 milliseconds 99.91% <= 10 milliseconds 99.92% <= 111 milliseconds 99.93% <= 112 milliseconds 99.96% <= 113 milliseconds 99.96% <= 115 milliseconds 100.00% <= 116 milliseconds 100.00% <= 116 milliseconds 43252.59 requests per second ``` QPS4W~6W

-d:存取大小为100字节的数据包

➜  ~ git:(master) ✗ redis-benchmark -h 127.0.0.1 -p 6379 -q -d 100 PING_INLINE: 57208.24 requests per second PING_BULK: 54495.91 requests per second SET: 41118.42 requests per second GET: 57636.89 requests per second INCR: 57471.27 requests per second LPUSH: 54525.63 requests per second RPUSH: 52192.07 requests per second LPOP: 53106.74 requests per second RPOP: 48851.98 requests per second SADD: 46838.41 requests per second HSET: 49019.61 requests per second SPOP: 42480.88 requests per second LPUSH (needed to benchmark LRANGE): 50813.01 requests per second ^CANGE_100 (first 100 elements): 54930.19

-t set,lpush:只测试set,lpush命令 -t:只测试某些操作的性能

➜ ~ git:(master) ✗ redis-benchmark -t set,lpush -n 10000 -q 

SET: 56179.77 requests per second LPUSH: 36496.35 requests per second

script load "":测试某些命令的性能

➜ ~ git:(master) ✗ redis-benchmark -n 100000 -q script load "redis.call('set',''foo','bar')” 

script load redis.call('set',''foo','bar'): 61162.08 requests per second

你可能感兴趣的:(java)