基础环境配置:Redis5 三主三从cluster
1、100个并发连接,100000个请求,检测host为172.16.254.124端口为7004的redis服务器性能
1 | redis-benchmark -h 172.16.254.124 -p 7004 -c 100 -n 100000 |
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 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | ====== PING_INLINE ====== 100000 requests completed in 1.71 seconds 100 parallel clients 3 bytes payload keep alive: 1 72.54% <= 1 milliseconds 98.24% <= 2 milliseconds 99.80% <= 3 milliseconds 99.92% <= 6 milliseconds 99.96% <= 7 milliseconds 100.00% <= 7 milliseconds 58513.75 requests per second ====== PING_BULK ====== 100000 requests completed in 1.71 seconds 100 parallel clients 3 bytes payload keep alive: 1 78.17% <= 1 milliseconds 96.93% <= 2 milliseconds 99.53% <= 3 milliseconds 99.74% <= 4 milliseconds 99.81% <= 5 milliseconds 99.90% <= 6 milliseconds 99.96% <= 10 milliseconds 99.96% <= 11 milliseconds 100.00% <= 11 milliseconds 58411.21 requests per second ====== SET ====== 100000 requests completed in 1.65 seconds 100 parallel clients 3 bytes payload keep alive: 1 84.03% <= 1 milliseconds 98.08% <= 2 milliseconds 99.77% <= 3 milliseconds 99.80% <= 5 milliseconds 99.82% <= 6 milliseconds 99.95% <= 7 milliseconds 100.00% <= 7 milliseconds 60679.61 requests per second ====== GET ====== 100000 requests completed in 1.62 seconds 100 parallel clients 3 bytes payload keep alive: 1 86.78% <= 1 milliseconds 98.19% <= 2 milliseconds 99.63% <= 3 milliseconds 99.93% <= 4 milliseconds 99.95% <= 5 milliseconds 99.95% <= 6 milliseconds 100.00% <= 6 milliseconds 61766.52 requests per second ====== INCR ====== 100000 requests completed in 1.64 seconds 100 parallel clients 3 bytes payload keep alive: 1 82.68% <= 1 milliseconds 97.82% <= 2 milliseconds 99.69% <= 3 milliseconds 99.87% <= 4 milliseconds 99.90% <= 6 milliseconds 99.96% <= 7 milliseconds 100.00% <= 7 milliseconds 61087.36 requests per second ====== LPUSH ====== 100000 requests completed in 2.08 seconds 100 parallel clients 3 bytes payload keep alive: 1 13.72% <= 1 milliseconds 92.05% <= 2 milliseconds 99.23% <= 3 milliseconds 99.76% <= 4 milliseconds 99.80% <= 5 milliseconds 99.88% <= 6 milliseconds 99.90% <= 8 milliseconds 99.90% <= 15 milliseconds 99.91% <= 21 milliseconds 99.91% <= 22 milliseconds 99.97% <= 23 milliseconds 100.00% <= 23 milliseconds 48100.05 requests per second ====== RPUSH ====== 100000 requests completed in 1.74 seconds 100 parallel clients 3 bytes payload keep alive: 1 29.96% <= 1 milliseconds 94.94% <= 2 milliseconds 99.32% <= 3 milliseconds 99.97% <= 4 milliseconds 100.00% <= 4 milliseconds 57570.52 requests per second ====== LPOP ====== 100000 requests completed in 1.82 seconds 100 parallel clients 3 bytes payload keep alive: 1 25.36% <= 1 milliseconds 92.14% <= 2 milliseconds 99.16% <= 3 milliseconds 99.90% <= 4 milliseconds 99.90% <= 5 milliseconds 99.92% <= 6 milliseconds 99.95% <= 7 milliseconds 99.98% <= 8 milliseconds 100.00% <= 8 milliseconds 54824.56 requests per second ====== RPOP ====== 100000 requests completed in 1.81 seconds 100 parallel clients 3 bytes payload keep alive: 1 31.58% <= 1 milliseconds 94.07% <= 2 milliseconds 98.94% <= 3 milliseconds 99.90% <= 4 milliseconds 100.00% <= 5 milliseconds 55218.11 requests per second ====== SADD ====== 100000 requests completed in 1.62 seconds 100 parallel clients 3 bytes payload keep alive: 1 85.65% <= 1 milliseconds 98.11% <= 2 milliseconds 99.73% <= 3 milliseconds 99.92% <= 4 milliseconds 100.00% <= 5 milliseconds 61576.36 requests per second ====== HSET ====== 100000 requests completed in 1.57 seconds 100 parallel clients 3 bytes payload keep alive: 1 88.79% <= 1 milliseconds 98.84% <= 2 milliseconds 99.79% <= 3 milliseconds 99.85% <= 4 milliseconds 99.89% <= 5 milliseconds 99.90% <= 8 milliseconds 99.95% <= 9 milliseconds 99.99% <= 10 milliseconds 100.00% <= 10 milliseconds 63532.40 requests per second ====== SPOP ====== 100000 requests completed in 1.73 seconds 100 parallel clients 3 bytes payload keep alive: 1 73.73% <= 1 milliseconds 97.28% <= 2 milliseconds 99.78% <= 3 milliseconds 99.90% <= 5 milliseconds 99.94% <= 6 milliseconds 99.98% <= 7 milliseconds 100.00% <= 7 milliseconds 57670.13 requests per second ====== LPUSH (needed to benchmark LRANGE) ====== 100000 requests completed in 1.68 seconds 100 parallel clients 3 bytes payload keep alive: 1 30.56% <= 1 milliseconds 92.52% <= 2 milliseconds 99.34% <= 3 milliseconds 99.97% <= 4 milliseconds 100.00% <= 4 milliseconds 59594.76 requests per second ====== LRANGE_100 (first 100 elements) ====== 100000 requests completed in 2.99 seconds 100 parallel clients 3 bytes payload keep alive: 1 0.34% <= 1 milliseconds 81.88% <= 2 milliseconds 95.99% <= 3 milliseconds 98.89% <= 4 milliseconds 99.71% <= 5 milliseconds 99.87% <= 6 milliseconds 99.94% <= 7 milliseconds 99.97% <= 8 milliseconds 99.98% <= 9 milliseconds 100.00% <= 10 milliseconds 33400.13 requests per second ====== LRANGE_300 (first 300 elements) ====== 100000 requests completed in 7.76 seconds 100 parallel clients 3 bytes payload keep alive: 1 0.01% <= 1 milliseconds 0.16% <= 2 milliseconds 7.91% <= 3 milliseconds 52.84% <= 4 milliseconds 81.97% <= 5 milliseconds 93.00% <= 6 milliseconds 97.40% <= 7 milliseconds 98.54% <= 8 milliseconds 99.03% <= 9 milliseconds 99.36% <= 10 milliseconds 99.59% <= 11 milliseconds 99.70% <= 12 milliseconds 99.78% <= 13 milliseconds 99.84% <= 14 milliseconds 99.90% <= 15 milliseconds 99.94% <= 16 milliseconds 99.96% <= 17 milliseconds 99.97% <= 18 milliseconds 99.98% <= 19 milliseconds 99.99% <= 20 milliseconds 99.99% <= 21 milliseconds 100.00% <= 22 milliseconds 12894.91 requests per second ====== LRANGE_500 (first 450 elements) ====== 100000 requests completed in 11.93 seconds 100 parallel clients 3 bytes payload keep alive: 1 0.00% <= 1 milliseconds 0.02% <= 2 milliseconds 0.12% <= 3 milliseconds 2.43% <= 4 milliseconds 20.42% <= 5 milliseconds 49.68% <= 6 milliseconds 69.88% <= 7 milliseconds 85.24% <= 8 milliseconds 94.16% <= 9 milliseconds 97.79% <= 10 milliseconds 98.70% <= 11 milliseconds 99.03% <= 12 milliseconds 99.26% <= 13 milliseconds 99.44% <= 14 milliseconds 99.57% <= 15 milliseconds 99.68% <= 16 milliseconds 99.78% <= 17 milliseconds 99.85% <= 18 milliseconds 99.90% <= 19 milliseconds 99.93% <= 20 milliseconds 99.95% <= 21 milliseconds 99.96% <= 22 milliseconds 99.97% <= 23 milliseconds 99.98% <= 24 milliseconds 99.98% <= 26 milliseconds 99.98% <= 27 milliseconds 99.99% <= 28 milliseconds 100.00% <= 29 milliseconds 100.00% <= 29 milliseconds 8385.74 requests per second ====== LRANGE_600 (first 600 elements) ====== 100000 requests completed in 14.80 seconds 100 parallel clients 3 bytes payload keep alive: 1 0.00% <= 1 milliseconds 0.02% <= 2 milliseconds 0.04% <= 3 milliseconds 0.20% <= 4 milliseconds 2.88% <= 5 milliseconds 15.84% <= 6 milliseconds 40.24% <= 7 milliseconds 61.00% <= 8 milliseconds 74.88% <= 9 milliseconds 85.65% <= 10 milliseconds 93.36% <= 11 milliseconds 97.13% <= 12 milliseconds 98.37% <= 13 milliseconds 98.87% <= 14 milliseconds 99.14% <= 15 milliseconds 99.32% <= 16 milliseconds 99.42% <= 17 milliseconds 99.50% <= 18 milliseconds 99.59% <= 19 milliseconds 99.65% <= 20 milliseconds 99.69% <= 21 milliseconds 99.74% <= 22 milliseconds 99.78% <= 23 milliseconds 99.82% <= 24 milliseconds 99.86% <= 25 milliseconds 99.88% <= 26 milliseconds 99.90% <= 27 milliseconds 99.92% <= 28 milliseconds 99.94% <= 29 milliseconds 99.95% <= 30 milliseconds 99.96% <= 31 milliseconds 99.97% <= 32 milliseconds 99.98% <= 33 milliseconds 99.98% <= 34 milliseconds 99.99% <= 35 milliseconds 100.00% <= 36 milliseconds 100.00% <= 36 milliseconds 6755.39 requests per second ====== MSET (10 keys) ====== 100000 requests completed in 1.76 seconds 100 parallel clients 3 bytes payload keep alive: 1 53.95% <= 1 milliseconds 93.05% <= 2 milliseconds 99.56% <= 3 milliseconds 99.95% <= 4 milliseconds 100.00% <= 4 milliseconds 56915.20 requests per second |
2、测试存取大小为100字节的数据包的性能
1 | redis-benchmark -h 172.16.254.124 -p 7004 -c -q -d 100 |
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 | ====== PING_INLINE ====== 100000 requests completed in 6.18 seconds 0 parallel clients 100 bytes payload keep alive: 1 99.17% <= 1 milliseconds 99.98% <= 2 milliseconds 100.00% <= 3 milliseconds 16191.71 requests per second ====== PING_BULK ====== 100000 requests completed in 6.59 seconds 0 parallel clients 100 bytes payload keep alive: 1 99.18% <= 1 milliseconds 99.98% <= 2 milliseconds 100.00% <= 2 milliseconds 15169.90 requests per second ====== SET ====== 100000 requests completed in 5.67 seconds 0 parallel clients 100 bytes payload keep alive: 1 99.45% <= 1 milliseconds 99.98% <= 2 milliseconds 100.00% <= 2 milliseconds 17624.25 requests per second ====== GET ====== 100000 requests completed in 5.71 seconds 0 parallel clients 100 bytes payload keep alive: 1 99.71% <= 1 milliseconds 100.00% <= 2 milliseconds 100.00% <= 2 milliseconds 17500.88 requests per second ====== INCR ====== 100000 requests completed in 8.22 seconds 0 parallel clients 100 bytes payload keep alive: 1 98.28% <= 1 milliseconds 99.98% <= 2 milliseconds 100.00% <= 2 milliseconds 12171.37 requests per second ====== LPUSH ====== 100000 requests completed in 8.99 seconds 0 parallel clients 100 bytes payload keep alive: 1 98.91% <= 1 milliseconds 99.98% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 7 milliseconds 11117.29 requests per second ====== RPUSH ====== 100000 requests completed in 9.85 seconds 0 parallel clients 100 bytes payload keep alive: 1 98.70% <= 1 milliseconds 99.97% <= 2 milliseconds 100.00% <= 6 milliseconds 10151.25 requests per second ====== LPOP ====== 100000 requests completed in 8.39 seconds 0 parallel clients 100 bytes payload keep alive: 1 99.36% <= 1 milliseconds 99.99% <= 2 milliseconds 100.00% <= 4 milliseconds 100.00% <= 5 milliseconds 11920.37 requests per second ====== RPOP ====== 100000 requests completed in 8.11 seconds 0 parallel clients 100 bytes payload keep alive: 1 99.45% <= 1 milliseconds 99.99% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 4 milliseconds 100.00% <= 6 milliseconds 12325.90 requests per second ====== SADD ====== 100000 requests completed in 4.07 seconds 0 parallel clients 100 bytes payload keep alive: 1 99.94% <= 1 milliseconds 100.00% <= 2 milliseconds 100.00% <= 4 milliseconds 24576.06 requests per second ====== HSET ====== 100000 requests completed in 5.63 seconds 0 parallel clients 100 bytes payload keep alive: 1 99.62% <= 1 milliseconds 99.99% <= 2 milliseconds 100.00% <= 3 milliseconds 17752.53 requests per second ====== SPOP ====== 100000 requests completed in 7.51 seconds 0 parallel clients 100 bytes payload keep alive: 1 98.68% <= 1 milliseconds 99.98% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 5 milliseconds 13306.72 requests per second ====== LPUSH (needed to benchmark LRANGE) ====== 100000 requests completed in 9.73 seconds 0 parallel clients 100 bytes payload keep alive: 1 98.99% <= 1 milliseconds 99.96% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 5 milliseconds 100.00% <= 6 milliseconds 100.00% <= 18 milliseconds 10280.66 requests per second ====== LRANGE_100 (first 100 elements) ====== 100000 requests completed in 9.55 seconds 0 parallel clients 100 bytes payload keep alive: 1 99.37% <= 1 milliseconds 99.99% <= 2 milliseconds 100.00% <= 3 milliseconds 10474.50 requests per second ====== LRANGE_300 (first 300 elements) ====== 100000 requests completed in 26.23 seconds 0 parallel clients 100 bytes payload keep alive: 1 95.12% <= 1 milliseconds 99.97% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 3 milliseconds 3811.99 requests per second ====== LRANGE_500 (first 450 elements) ====== 100000 requests completed in 31.84 seconds 0 parallel clients 100 bytes payload keep alive: 1 97.06% <= 1 milliseconds 99.97% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 5 milliseconds 100.00% <= 5 milliseconds 3141.00 requests per second ====== LRANGE_600 (first 600 elements) ====== 100000 requests completed in 44.52 seconds 0 parallel clients 100 bytes payload keep alive: 1 94.49% <= 1 milliseconds 99.96% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 5 milliseconds 2246.33 requests per second ====== MSET (10 keys) ====== 100000 requests completed in 6.29 seconds 0 parallel clients 100 bytes payload keep alive: 1 99.46% <= 1 milliseconds 99.99% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 3 milliseconds 15893.20 requests per second |
3、对3000字节的数据进行set和get的操作
1 | redis-benchmark -h 172.16.254.124 -p 7004 -c -t set ,get -n 100000 -q -d 3000 |
1 2 3 4 5 6 7 8 9 | ====== set ,get -n 100000 -q -d 3000 ====== 100000 requests completed in 6.54 seconds 0 parallel clients 3 bytes payload keep alive: 1 99.18% <= 1 milliseconds 99.98% <= 2 milliseconds 100.00% <= 3 milliseconds 15295.20 requests per second |
4、测试某些值的存取功能
1 | redis-benchmark -h 172.16.254.124 -p 7004 -c -n 100000 -q script load "redis.call('set','foo','bar')" |
1 2 3 4 5 6 7 8 9 10 | ====== 100000 -q script load redis.call( 'set' , 'foo' , 'bar' ) ====== 100000 requests completed in 8.57 seconds 0 parallel clients 3 bytes payload keep alive: 1 97.98% <= 1 milliseconds 99.96% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 3 milliseconds 11664.53 requests per second |