-h <hostname> Server hostname (default 127.0.0.1) -p <port> Server port (default 6379) -s <socket> Server socket (overrides host and port) -c <clients> Number of parallel connections (default 50) -n <requests> Total numberof requests (default 10000) -d <size> Data size of SET/GET valueinbytes (default 2) -k <boolean> 1=keep alive 0=reconnect (default 1) -r <keyspacelen> Use randomkeysfor SET/GET/INCR, random values for SADD Using this option the benchmark will get/setkeys inthe form mykey_rand:000000012456 instead ofconstant keys, the <keyspacelen> argument determines themax numberof values fortherandomnumber. For instance ifsetto10 only rand:000000000000 - rand:000000000009 range will be allowed. -P <numreq> Pipeline <numreq> requests. Default 1 (no pipeline). -q Quiet. Just show query/sec values 只显示每秒钟能处理多少请求数结果 --csv Output in CSV format -l Loop. Run the tests forever 永久测试 -t <tests> Only run thecomma separated list of tests. The test names are the same asthe ones produced as output. -I Idle mode. Just open N idle connections andwait. redis-benchmark #SET/GET 100 bytes 检测host为127.0.0.1 端口为6379的redis服务器性能 redis-benchmark -h 127.0.0.1 -p 6379 -q -d 100 #5000个并发连接,100000个请求,检测host为127.0.0.1 端口为6379的redis服务器性能 redis-benchmark -h 127.0.0.1 -p 6379 -c 5000 -n 100000 redis-benchmark -n 100000 -c 60 向redis服务器发送100000个请求,每个请求附带60个并发客户端
可用命令
1 2
redis-stat vmstat redis-cli -p xxxx -h xxxx -a xxxx