01 服务器环境
Redis之redis-benchmark
redis 提供了 redis-benchmark 工具便于我们做性能测试,可以使用 redis-benchmark- h 查看参数。
01 Docker Redis测试
单并发测试
测试命令:
./redis-benchmark -c 1 -n 20000 -d 30720 -t set,get
测试结果每秒是 8000+的QPS
多并发测试
====== SET ======
20000 requests completed in 1.06 seconds
10 parallel clients
30720 bytes payload
keep alive: 1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
18903.59 requests per second
====== GET ======
20000 requests completed in 1.30 seconds
10 parallel clients
30720 bytes payload
keep alive: 1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
15360.98 requests per second
测试 -P 命令
====== SET ======
20007 requests completed in 0.47 seconds
50 parallel clients
30720 bytes payload
keep alive: 1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
42933.48 requests per second
====== GET ======
20002 requests completed in 0.44 seconds
50 parallel clients
30720 bytes payload
keep alive: 1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
45253.39 requests per second
02 redis6 安装版测试
单并发测试
SET ======
200000 requests completed in 20.20 seconds
1 parallel clients 3 bytes payload
keep alive: 1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
9900.01 requests per second
====== GET ======
200000 requests completed in 20.01 seconds
1 parallel clients
3 bytes payload
keep alive: 1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
9995.50 requests per second
多并发测试
====== SET ======
200000 requests completed in 3.00 seconds
10 parallel clients
3 bytes payload
keep alive: 1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
66622.25 requests per second
====== GET ======
200000 requests completed in 3.02 seconds
10 parallel clients
3 bytes payload
keep alive:1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
66137.57 requests per second
03 -P 测试
单并发测试
====== SET ======
200000 requests completed in 2.20 seconds
1 parallel clients
3 bytes payload
keep alive: 1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
90991.81 requests per second
====== GET ======
200000 requests completed in 2.15 seconds
1 parallel clients 3 bytes payload
keep alive: 1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
92980.01 requests per second
多并发测试
====== SET ======
200010 requests completed in 0.42 seconds
10 parallel clients 3 bytes payload
keep alive: 1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
480793.25 requests per second
====== GET ======
200000 requests completed in 0.34 seconds
10 parallel clients
3 bytes payload
keep alive: 1
host configuration "save": 900 1 300 10 60 10000
host configuration "appendonly": no
multi-thread: no
586510.25 requests per second