Я попытался выбрать между mysql:5.7
и mysql/mysql-server:5.7
образами Docker, используя 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