Mysql, Zookeeper, Redis, Mongodb stress test results

1. Redis (using fast redis client)

redis-shard 10连接
cpu 7-8% 9-12%
root@gleasy cloudredis]# bin/redis-benchmark -t get -h 192.168.0.11 -p 6680 -d 15 -l 60 -c 200 -b shard
成功:5740491
失败:0
总时间:11999368
最长用时:42
最短用时:0
平均用时:2.090303425264494
min tps:0
max tps:131439
avg tps:94106

cpu 9-12%
[root@gleasy cloudredis]# bin/redis-benchmark -t set -h 192.168.0.11 -p 6680 -d 15 -l 60 -c 200 -b shard
成功:5730516
失败:0
总时间:11999536
最长用时:205
最短用时:0
平均用时:2.093971293335539
min tps:0
max tps:109213
avg tps:93942

2. Mysql

Mysql 插入 1000线程 7000/s
target/benchtest/bin/TestMysql insert 1000 1000000 0
线程总时间:131320984;平均:131.320984
实际总时间:134504; 平均:0.134504

Mysql ibatis 插入 1000线程 5000/s
target/benchtest/bin/TestMysql insert 1000 1000000 0
线程总时间:131320984;平均:131.320984
实际总时间:134504; 平均:0.204504

Mysql 查询 1000线程 7000/s
target/benchtest/bin/TestMysql query 1000 200000 600000
线程总时间:27869248;平均:139.34624
实际总时间:29117; 平均:0.145585

Mysql ibatis 查询 1000线程 5000/s
target/benchtest/bin/TestMysql query 1000 200000 600000
线程总时间:27869248;平均:139.34624
实际总时间:29117; 平均:0.195585

Mysql 批量插入 500线程(50000/s)
target/benchtest/bin/TestMysql minsert 500 10000*100
线程总时间:10759531;平均:10.759531
实际总时间:22256; 平均:0.022256

3. Zookeeper

单结点:
set: tps 7500
get: tps 8700
del: tps 8400

4. Mongodb

写操作
200(线程数) 50000(记录数) add(操作) nbso online casino reviews writeConcern=normal
线程总时间:304881 最长用时:1928/250=7.712 最短用时:562/250=2.248 平均:6.09762
实际总时间:1933 平均: 1933/50000=0.03866 tps:25866.52871184687
200 50000 add writeConcern=safe (为保证数据正确,目前采用该方式)
线程总时间:1660848 最长用时:8580/250=34.32 最短用时:7401/250=29.604 平均:33.21696
实际总时间:8586 平均: 8586/50000=0.17172 tps:5823.433496389471

500 1000000 add writeConcern=normal
线程总时间:43969426 最长用时:108885/2000=54.4425 最短用时:61483/2000=30.7415 平均:43.969426
实际总时间:109016 平均: 109016/1000000=0.109016 tps:9172.965436266235
500 1000000 add writeConcern=safe
线程总时间:63972303 最长用时:129511/2000=64.7555 最短用时:122266/2000=61.133 平均:63.972303
实际总时间:129521 平均: 129521/1000000=0.129521 tps:7720.755707568657

1000 50000 add writeConcern=normal
线程总时间:2956438 最长用时:4276/50=85.52 最短用时:338/50=6.76 平均:59.12876
实际总时间:4303 平均: 4303/50000=0.08606 tps:11619.800139437602
1000 50000 add writeConcern=safe
线程总时间:7937768 最长用时:9196/50=183.92 最短用时:5995/50=119.9 平均:158.93826
实际总时间:9208 平均: 9208/50000=0.18416 tps:5430.060816681147

读操作
200 1000000 read
线程总时间:275106 最长用时:2116/5000=0.4232 最短用时:199/5000=0.0398 平均:0.275106
实际总时间:2137 平均: 2137/1000000=0.002137 tps:467945.7182966776

500 1000000 read
线程总时间:2205097 最长用时:5552/2000=2.776 最短用时:225/2000=0.1125 平均:2.205097
实际总时间:5576 平均: 5576/1000000=0.005576 tps:179340.0286944046

5. Summary
In the same hardware environment, the results of the author's test show that redis has the best performance in both read and write performance, reaching close to 100K; MongoDB 's read and write performance is seriously unbalanced, reading can reach more than 100K, but writing is only 5-6K , a huge difference of 15 times; Zookeeper has a TPS close to 8K in the case of nodes, and its performance is good, but it is not suitable for key performance occasions; Mysql's read and write performance is between 5K-10K, and batch operation performance excellent.
Performance is only one of the indicators to measure the pros and cons of a database. In a specific business scenario, it is necessary to comprehensively select the best storage solution or a combination of solutions to achieve the optimal design.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326437752&siteId=291194637