1

我尝试使用测试在 Docker 映像mysql:5.7和Docker 映像之间做出决定。结果复制如下。是否有一个似乎更快的原因(每秒事务数(vs )以及查询总数(vs ))?谢谢mysql/mysql-server:5.7sysbenchmysql:5.73395.53 per sec.2963.84 per sec.32597922845488

  1. mysql:5.7设置:
    1. docker-compose
    2. 安装sysbench
      1. apt update; apt -y install sysbench;
    3. prepare对于sysbench
      1. sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=root --mysql-password=test prepare;
    4. run对于sysbench
      1. 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;
    5. results
      1. 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
  1. mysql/mysql-server:5.7设置:
    1. docker-compose
    2. 安装sysbench
      1. yum -y update; yum -y install sysbench;
    3. prepare对于sysbench
      1. 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;
    4. run对于sysbench
      1. 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;
    5. results
      1. 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
4

0 回答 0