Redis性能测试Redis-benchmark
Redis-benchmark是官方自带的Redis性能测试工具, 使用简单:
gitlib@devops:/usr/local/redis/src$ ls -al | grep 'redis-*'
-rwxr-xr-x 1 root root 2683672 Aug 10 19:13 redis-benchmark
-rwxr-xr-x 1 root root 28848 Aug 10 19:13 redis-check-aof
-rwxr-xr-x 1 root root 5559800 Aug 10 19:13 redis-check-rdb
-rwxr-xr-x 1 root root 2859920 Aug 10 19:13 redis-cli
-rwxr-xr-x 1 root root 5559800 Aug 10 19:13 redis-sentinel
-rwxr-xr-x 1 root root 5559800 Aug 10 19:13 redis-server
-rwxr-xr-x 1 root root 60852 Aug 10 19:12 redis-trib.rb
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
压测命令:redis-benchmark -h 127.0.0.1 -p 6379 -c 50 -n 10000
# 使用测试
gitlib@devops:/usr/local/redis/src$ ./redis-benchmark -c 5 -n 10000
====== PING_INLINE ======
10000 requests completed in 0.31 seconds
5 parallel clients
3 bytes payload
keep alive: 1
100.00% <= 0 milliseconds
32573.29 requests per second
====== PING_BULK ======
10000 requests completed in 0.32 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.86% <= 1 milliseconds
99.96% <= 3 milliseconds
100.00% <= 3 milliseconds
31545.74 requests per second
====== SET ======
10000 requests completed in 0.32 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.96% <= 1 milliseconds
100.00% <= 1 milliseconds
30769.23 requests per second
====== GET ======
10000 requests completed in 0.33 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.93% <= 1 milliseconds
100.00% <= 1 milliseconds
30581.04 requests per second
====== INCR ======
10000 requests completed in 0.33 seconds
5 parallel clients
3 bytes payload
keep alive: 1
100.00% <= 1 milliseconds
30581.04 requests per second
====== LPUSH ======
10000 requests completed in 0.37 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.72% <= 1 milliseconds
99.79% <= 2 milliseconds
99.85% <= 3 milliseconds
99.96% <= 4 milliseconds
100.00% <= 4 milliseconds
27247.96 requests per second
====== RPUSH ======
10000 requests completed in 0.32 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.95% <= 1 milliseconds
100.00% <= 1 milliseconds
31645.57 requests per second
====== LPOP ======
10000 requests completed in 0.33 seconds
5 parallel clients
3 bytes payload
keep alive: 1
100.00% <= 1 milliseconds
30303.03 requests per second
====== RPOP ======
10000 requests completed in 0.31 seconds
5 parallel clients
3 bytes payload
keep alive: 1
100.00% <= 2 milliseconds
31746.03 requests per second
====== SADD ======
10000 requests completed in 0.33 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.97% <= 1 milliseconds
100.00% <= 1 milliseconds
30674.85 requests per second
====== HSET ======
10000 requests completed in 0.32 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.95% <= 1 milliseconds
100.00% <= 1 milliseconds
31645.57 requests per second
====== SPOP ======
10000 requests completed in 0.26 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.91% <= 2 milliseconds
99.96% <= 4 milliseconds
100.00% <= 4 milliseconds
37878.79 requests per second
====== LPUSH (needed to benchmark LRANGE) ======
10000 requests completed in 0.26 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.99% <= 1 milliseconds
100.00% <= 3 milliseconds
38022.81 requests per second
====== LRANGE_100 (first 100 elements) ======
10000 requests completed in 0.66 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.11% <= 1 milliseconds
99.59% <= 2 milliseconds
99.68% <= 3 milliseconds
99.81% <= 4 milliseconds
99.88% <= 5 milliseconds
99.90% <= 7 milliseconds
99.98% <= 13 milliseconds
100.00% <= 13 milliseconds
15220.70 requests per second
====== LRANGE_300 (first 300 elements) ======
10000 requests completed in 1.33 seconds
5 parallel clients
3 bytes payload
keep alive: 1
97.36% <= 1 milliseconds
99.13% <= 2 milliseconds
99.55% <= 3 milliseconds
99.82% <= 4 milliseconds
99.94% <= 5 milliseconds
99.95% <= 6 milliseconds
99.97% <= 7 milliseconds
100.00% <= 7 milliseconds
7530.12 requests per second
====== LRANGE_500 (first 450 elements) ======
10000 requests completed in 1.17 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.60% <= 1 milliseconds
99.84% <= 2 milliseconds
99.91% <= 3 milliseconds
99.97% <= 4 milliseconds
100.00% <= 4 milliseconds
8525.15 requests per second
====== LRANGE_600 (first 600 elements) ======
10000 requests completed in 1.44 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.87% <= 1 milliseconds
99.92% <= 2 milliseconds
100.00% <= 3 milliseconds
6954.10 requests per second
====== MSET (10 keys) ======
10000 requests completed in 0.28 seconds
5 parallel clients
3 bytes payload
keep alive: 1
99.69% <= 1 milliseconds
99.81% <= 2 milliseconds
99.91% <= 4 milliseconds
99.97% <= 6 milliseconds
100.00% <= 6 milliseconds
35335.69 requests per second
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
上次更新: 2022/12/01, 11:09:34