Redis-benchmark测试

来源:互联网 发布:一键获取网站源码 编辑:程序博客网 时间:2024/05/16 14:25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Usage: redis-benchmark [-h <host>] [-p <port>] [-c <clients>] [-n <requests]> [-k <boolean>]  
   
-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 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 random keys for SET/GET/INCR, random values for SADD  
  Using this option the benchmark will 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 10 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 the comma separated list of tests. The test  
                    names are the same as the ones produced as output.  
-I                 Idle mode. Just open N idle connections and wait.



实例:

redis-benchmark -h 127.0.0.1 -p 6379 -q -d 100  
SET/GET 100 bytes 检测host为127.0.0.1 端口为6379的redis服务器性能


redis-benchmark -h 127.0.0.1 -p 6379 -c 5000 -n 100000 
5000个并发连接,100000个请求,检测host为127.0.0.1 端口为6379的redis服务器性能 




benchmark工具测试信息:
测试命令:
redis-benchmark -n 100000 -c 60
向redis服务器发送100000个请求,每个请求附带60个并发客户端
结果(部分):
====== SET ======
对集合写入测试
  100000 requests completed in 2.38 seconds
100000个请求在2.38秒内完成
  60 parallel clients
每次请求有60个并发客户端
  3 bytes payload
每次写入3个字节的数据
  keep alive: 1
保持一个连接,一台服务器来处理这些请求


93.06% <= 15 milliseconds
99.96% <= 31 milliseconds
99.98% <= 46 milliseconds
99.99% <= 62 milliseconds
100.00% <= 62 milliseconds
所有请求在62毫秒内完成
42105.26 requests per second
每秒处理42105.26次请求

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
D:\redis\32bit>redis-benchmark.exe  -h 127.0.0.1 -p 6379 -c 50 -n 100000  -d 100
 -q
PING (inline): 43459.37 requests per second
PING: 44385.27 requests per second
MSET (10 keys): 34722.22 requests per second
SET: 45085.66 requests per second
GET: 42390.84 requests per second
INCR: 46511.63 requests per second
LPUSH: 46598.32 requests per second
LPOP: 44208.66 requests per second
SADD: 46189.38 requests per second
SPOP: 42247.57 requests per second
LPUSH (again, in order to bench LRANGE): 41425.02 requests per second
LRANGE (first 100 elements): 10055.30 requests per second
LRANGE (first 300 elements): 3786.44 requests per second
LRANGE (first 450 elements): 2476.53 requests per second
LRANGE (first 600 elements): 1885.19 requests per second



redis server 如下:

?
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
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54436
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54437
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54438
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54439
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54440
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54441
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54442
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54443
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54444
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54445
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54446
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54447
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54448
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54449
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54450
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54451
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54452
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54453
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54454
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54455
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54456
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54457
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54458
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54459
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54460
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54461
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54462
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54463
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54464
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54465
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54466
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54467
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54468
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54469
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54470
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54471
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54472
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54473
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54474
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54475
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54476
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54477
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54478
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54479
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54480
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54481
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54482
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54483
[4912] 15 Sep 14:44:06 - Accepted 127.0.0.1:54484
[4912] 15 Sep 14:44:08 - DB 0: 23 keys (0 volatile) in 32 slots HT.
[4912] 15 Sep 14:44:08 - 50 clients connected (0 slaves), 32097952 bytes in use
[4912] 15 Sep 14:44:13 - DB 0: 23 keys (0 volatile) in 32 slots HT.
[4912] 15 Sep 14:44:13 - 50 clients connected (0 slaves), 32153760 bytes in use
0 0
原创粉丝点击