1REDIS-BENCHMARK(1) User commands REDIS-BENCHMARK(1)
2
3
4
6 redis-benchmark - Redis benchmark
7
8
10 redis-benchmark [ options ]
11
13 Redis is an open source (BSD licensed), in-memory data structure store,
14 used as database, cache and message broker, found at http://redis.io/
15
16 The redis-benchmark command is a command to benchmark redis-server.
17
18
20 -h hostname Server hostname (default: 127.0.0.1).
21
22 -p port Server port (default: 6379).
23
24 -s socket Server socket (overrides hostname and port).
25
26 -a password Password to use when connecting to the server.
27
28 -c clients Number of parallel connections (default 50)
29
30 -dnnum db SELECT the specified db number (default 0)
31
32 -k boolean 1=keep alive 0=reconnect (default 1)
33
34 -r keyspacelen Use random keys for SET/GET/INCR, random values for SADD
35 Using this option the benchmark will expand the string
36 __rand_int__ inside an argument with a 12 digits number
37 in the specified range from 0 to keyspacelen-1. The sub‐
38 stitution changes every time a command is executed.
39 Default tests use this to hit random keys in the speci‐
40 fied range.
41
42 -P numreq Pipeline <numreq> requests. Default 1 (no pipeline).
43
44 -e If server replies with errors, show them on stdout. (no
45 more than 1 error per second is displayed)
46
47 -q Quiet. Just show query/sec values
48
49 --csv Output in CSV format
50
51 -l Loop. Run the tests forever
52
53 -t tests Only run the comma separated list of tests. The test
54 names are the same as the ones produced as output.
55
56 -I Idle mode. Just open N idle connections and wait.
57
58
60 Run the benchmark with the default configuration against
61 127.0.0.1:6379:
62 $ redis-benchmark
63
64 Use 20 parallel clients, for a total of 100k requests, against
65 192.168.1.1:
66 $ redis-benchmark -h 192.168.1.1 -p 6379 -n 100000 -c 20
67
68 Fill 127.0.0.1:6379 with about 1 million keys only using the SET test:
69 $ redis-benchmark -t set -n 1000000 -r 100000000
70
71 Benchmark 127.0.0.1:6379 for a few commands producing CSV output:
72 $ redis-benchmark -t ping,set,get -n 100000 --csv
73
74 Benchmark a specific command line:
75 $ redis-benchmark -r 10000 -n 10000 eval 'return
76 redis.call("ping")' 0
77
78 Fill a list with 10000 random elements:
79 $ redis-benchmark -r 10000 -n 10000 lpush mylist __rand_int__
80
81 On user specified command lines __rand_int__ is replaced with a random
82 integer
83 with a range of values selected by the -r option.
84
85
86
88 See: http://redis.io/support and
89 https://github.com/antirez/redis/issues
90
92 Copyright © 2006-2016 Salvatore Sanfilippo
93 Redistribution and use in source and binary forms, with or without mod‐
94 ification, are permitted provided that the following conditions are
95 met:
96 * Redistributions of source code must retain the above copyright
97 notice, this list of conditions and the following disclaimer.
98 * Redistributions in binary form must reproduce the above copyright
99 notice, this list of conditions and the following disclaimer in the
100 documentation and/or other materials provided with the distribution.
101 * Neither the name of Redis nor the names of its contributors may be
102 used to endorse or promote products derived from this software with‐
103 out specific prior written permission.
104 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
105 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
106 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC‐
107 ULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
108 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
109 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
110 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
111 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
112 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
113 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
114 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
115
116
117
118Redis 2016 REDIS-BENCHMARK(1)