我尝试使用测试在 Docker 映像mysql:5.7
和Docker 映像之间做出决定。结果复制如下。是否有一个似乎更快的原因(每秒事务数(vs )以及查询总数(vs ))?谢谢mysql/mysql-server:5.7
sysbench
mysql:5.7
3395.53 per sec.
2963.84 per sec.
3259792
2845488
mysql:5.7
设置:docker-compose
- 安装
sysbench
:apt update; apt -y install sysbench;
prepare
对于sysbench
:sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=root --mysql-password=test prepare;
run
对于sysbench
:sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=root --mysql-password=test --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=8 run;
results
:sysbench 0.4.12: multi-threaded system evaluation benchmark
OLTP test statistics:
queries performed:
read: 2852318
write: 0
other: 407474
total: 3259792
transactions: 203737 (3395.53 per sec.)
deadlocks: 0 (0.00 per sec.)
read/write requests: 2852318 (47537.40 per sec.)
other operations: 407474 (6791.06 per sec.)
Test execution summary:
total time: 60.0016s
total number of events: 203737
total time taken by event execution: 479.2465
per-request statistics:
min: 0.98ms
avg: 2.35ms
max: 26.27ms
approx. 95 percentile: 3.31ms
Threads fairness:
events (avg/stddev): 25467.1250/717.45
execution time (avg/stddev): 59.9058/0.00
mysql/mysql-server:5.7
设置:docker-compose
- 安装
sysbench
:yum -y update; yum -y install sysbench;
prepare
对于sysbench
:sysbench --db-driver=mysql --mysql-user=root --mysql-password=test --mysql-db=test --table_size=1000000 --threads=8 --events=0 --time=60 /usr/share/sysbench/oltp_read_only.lua prepare;
run
对于sysbench
:sysbench --db-driver=mysql --mysql-user=root --mysql-password=test --mysql-db=test --table_size=1000000 --threads=8 --events=0 --time=60 /usr/share/sysbench/oltp_read_only.lua run;
results
:sysbench 1.0.17 (using system LuaJIT 2.0.4)
SQL statistics:
queries performed:
read: 2489802
write: 0
other: 355686
total: 2845488
transactions: 177843 (2963.84 per sec.)
queries: 2845488 (47421.48 per sec.)
ignored errors: 0 (0.00 per sec.)
reconnects: 0 (0.00 per sec.)
General statistics:
total time: 60.0028s
total number of events: 177843
Latency (ms):
min: 1.02
avg: 2.70
max: 34.34
95th percentile: 3.89
sum: 479685.39
Threads fairness:
events (avg/stddev): 22230.3750/427.52
execution time (avg/stddev): 59.9607/0.00