当前位置: 首页 > 工具软件 > mysqlslap > 使用案例 >

docker和windows下使用mysqlslap测试mysql性能

吴高洁
2023-12-01

windows

打开cmd,输入

C:\Users\Administrator>mysqlslap -uroot -p123456789 --concurrency=1,50,100,200 --iterations=3 --number-int-cols=5 --number-char-cols=5 --auto-generate-sql --auto-genera
te-sql-add-autoincrement --engine=myisam,innodb --number-of-queries=10 --create-schema=databasename
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
        Running for engine myisam
        Average number of seconds to run all queries: 0.010 seconds
        Minimum number of seconds to run all queries: 0.000 seconds
        Maximum number of seconds to run all queries: 0.016 seconds
        Number of clients running queries: 1
        Average number of queries per client: 10

Benchmark
        Running for engine myisam
        Average number of seconds to run all queries: 0.114 seconds
        Minimum number of seconds to run all queries: 0.047 seconds
        Maximum number of seconds to run all queries: 0.187 seconds
        Number of clients running queries: 50
        Average number of queries per client: 0

Benchmark
        Running for engine myisam
        Average number of seconds to run all queries: 0.067 seconds
        Minimum number of seconds to run all queries: 0.000 seconds
        Maximum number of seconds to run all queries: 0.156 seconds
        Number of clients running queries: 100
        Average number of queries per client: 0

Benchmark
        Running for engine myisam
        Average number of seconds to run all queries: 0.578 seconds
        Minimum number of seconds to run all queries: 0.235 seconds
        Maximum number of seconds to run all queries: 1.219 seconds
        Number of clients running queries: 200
        Average number of queries per client: 0

Benchmark
        Running for engine innodb
        Average number of seconds to run all queries: 0.015 seconds
        Minimum number of seconds to run all queries: 0.015 seconds
        Maximum number of seconds to run all queries: 0.016 seconds
        Number of clients running queries: 1
        Average number of queries per client: 10

Benchmark
        Running for engine innodb
        Average number of seconds to run all queries: 0.219 seconds
        Minimum number of seconds to run all queries: 0.203 seconds
        Maximum number of seconds to run all queries: 0.250 seconds
        Number of clients running queries: 50
        Average number of queries per client: 0

Benchmark
        Running for engine innodb
        Average number of seconds to run all queries: 0.765 seconds
        Minimum number of seconds to run all queries: 0.406 seconds
        Maximum number of seconds to run all queries: 1.437 seconds
        Number of clients running queries: 100
        Average number of queries per client: 0

Benchmark
        Running for engine innodb
        Average number of seconds to run all queries: 1.890 seconds
        Minimum number of seconds to run all queries: 1.782 seconds
        Maximum number of seconds to run all queries: 2.062 seconds
        Number of clients running queries: 200
        Average number of queries per client: 0


C:\Users\Administrator>

 

docker下

[root@VM_0_8_centos ~]# docker ps
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS              PORTS                                                                                        NAMES
89c5b9c81e74        hub.c.163.com/library/mysql:latest   "docker-entrypoint..."   3 months ago        Up 3 months         0.0.0.0:3306->3306/tcp  

 

docker ps查看到mysql在运行  CONTAINER ID为89c5b9c81e74      

 


[root@VM_0_8_centos ~]# docker exec -it 89c5b9c81e74  bash

root@89c5b9c81e74:/# mysqlslap -uroot -p123456789 --concurrency=1,50,100,200 --iterations=3 --number-int--number-char-cols=5 --auto-generate-sql --auto-generate-sql-add-autoincrement --engine=myisam,innodb --nuqueries=10 --create-schema=imooc
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
    Running for engine myisam
    Average number of seconds to run all queries: 0.001 seconds
    Minimum number of seconds to run all queries: 0.001 seconds
    Maximum number of seconds to run all queries: 0.001 seconds
    Number of clients running queries: 1
    Average number of queries per client: 10

Benchmark
    Running for engine myisam
    Average number of seconds to run all queries: 0.067 seconds
    Minimum number of seconds to run all queries: 0.065 seconds
    Maximum number of seconds to run all queries: 0.072 seconds
    Number of clients running queries: 50
    Average number of queries per client: 0

Benchmark
    Running for engine myisam
    Average number of seconds to run all queries: 0.146 seconds
    Minimum number of seconds to run all queries: 0.130 seconds
    Maximum number of seconds to run all queries: 0.159 seconds
    Number of clients running queries: 100
    Average number of queries per client: 0

Benchmark
    Running for engine myisam
    Average number of seconds to run all queries: 0.261 seconds
    Minimum number of seconds to run all queries: 0.250 seconds
    Maximum number of seconds to run all queries: 0.275 seconds
    Number of clients running queries: 200
    Average number of queries per client: 0

Benchmark
    Running for engine innodb
    Average number of seconds to run all queries: 0.053 seconds
    Minimum number of seconds to run all queries: 0.045 seconds
    Maximum number of seconds to run all queries: 0.061 seconds
    Number of clients running queries: 1
    Average number of queries per client: 10

Benchmark
    Running for engine innodb
    Average number of seconds to run all queries: 0.359 seconds
    Minimum number of seconds to run all queries: 0.295 seconds
    Maximum number of seconds to run all queries: 0.443 seconds
    Number of clients running queries: 50
    Average number of queries per client: 0

Benchmark
    Running for engine innodb
    Average number of seconds to run all queries: 0.877 seconds
    Minimum number of seconds to run all queries: 0.847 seconds
    Maximum number of seconds to run all queries: 0.906 seconds
    Number of clients running queries: 100
    Average number of queries per client: 0

mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1040 Too many connections
Benchmark
    Running for engine innodb
    Average number of seconds to run all queries: 1.108 seconds
    Minimum number of seconds to run all queries: 1.052 seconds
    Maximum number of seconds to run all queries: 1.172 seconds
    Number of clients running queries: 200
    Average number of queries per client: 0
 

 

 类似资料: