Reprinted from http://blog.csdn.net/jiangguilong2000/article/details/24143721
Redis-benchmark is a Redis performance testing tool.
Instruction Description:
- Usage:redis-benchmark [-H
- -H
- -P <port> Server port (default 6379)
- -S <socket> Server sockets (Overrides host and Port)
- -c <clients> Number of parallel connections (default 50)
- -N <requests> Total number of requests (default 10000)
- -D <size> Data size of set/get value in bytes (default 2)
- -K <boolean> 1=keep Alive 0=reconnect (default 1)
- -R <keyspacelen> Use the random keys for SET/GET/INCR, random values for sadd
- Using This option the benchmark would get/set keys
- In the form mykey_rand:000000012456 instead of constant
- Keys, the <keyspacelen> argument determines the max
- Number of values for the random number. For instance
- if set to ten only rand:000000000000-rand:000000000009
- Range would be allowed.
- -P <numreq> Pipeline <numreq> requests. Default 1 (no pipeline).
- -Q Quiet. Just show query/sec values shows the results of how many requests per second can be processed
- --csv Output in csv format
- -L Loop. Run The tests Forever Permanent test
- -T <tests> only run the comma separated list of tests. The test
- Names is the same as the ones produced as output.
- -I Idle mode. Just Open N idle connections and wait.
Instance:
Redis-benchmark-h 127.0.0.1-p 6379-q-D 100
Set/get bytes detects Redis server performance with host 127.0.0.1 Port 6379
Redis-benchmark-h 127.0.0.1-p 6379-c 5000-n 100000
5,000 concurrent connections, 100,000 requests, detects Redis server performance with host 127.0.0.1 Port 6379
Benchmark Tool Test Information:
Test command:
Redis-benchmark-n 100000-C 60
Send 100,000 requests to the Redis server with 60 concurrent clients per request
Results (partial):
====== SET ======
Writing a test to a collection
100000 requests completed in 2.38 seconds
100,000 requests completed in 2.38 seconds
Parallel clients
60 Concurrent Clients per request
3 bytes Payload
Write 3 bytes of data at a time
Keep Alive:1
Keep a connection, a server to process these requests
93.06% <= milliseconds
99.96% <= milliseconds
99.98% <= milliseconds
99.99% <= milliseconds
100.00% <= milliseconds
All requests are completed within 62 milliseconds
42105.26 Requests per second
Processing 42105.26 Requests Per second
- [Email protected] ~]# redis-benchmark-h 127.0.0.1-p 6379-c 5000-n 100000-d 100-q
- ping_inline:34506.55 Requests per second
- ping_bulk:34059.95 Requests per second
- set:31959.09 Requests per second
- get:31466.33 Requests per second
- incr:33311.12 Requests per second
- lpush:29265.44 Requests per second
- lpop:36968.58 Requests per second
- sadd:32030.75 Requests per second
- spop:33344.45 Requests per second
- Lpush (needed to benchmark Lrange): 29735.36 Requests per second
- LRANGE_100 (first elements): 16116.04 requests per second
- lrange_300 (first elements): 6659.56 requests per second
- lrange_500 (first elements): 4108.29 requests per second
Reproduced Redis-benchmark Usage Summary