【MySQL】InnoDB引擎TokuDB引擎对比测试

前言:前段时间做服务器性能压测时,顺便也一起做了innodb与tokudb引擎的性能压测,测试方法及测试结果如下。

innodb:

[root@localhost bin]# ./mysqlslap -uroot -p –S /tmp/mysql3306.sock --concurrency=100 --iterations=5 --auto-generate-sql --auto-generate-sql-load-type=write --auto-generate-sql-add-autoincrement --engine=innodb  --auto-generate-sql-write-number 1000000 --debug-info
Enter password: 
Benchmark
    Running for engine innodb
    Average number of seconds to run all queries: 0.044 seconds
    Minimum number of seconds to run all queries: 0.041 seconds
    Maximum number of seconds to run all queries: 0.047 seconds
    Number of clients running queries: 100
    Average number of queries per client: 0


User time 4.80, System time 27.39
Maximum resident set size 71136, Integral resident set size 0
Non-physical pagefaults 93212, Physical pagefaults 0, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 10018141, Involuntary context switches 121

tokudb:

[root@localhost bin]# ./mysqlslap -uroot -p –S /tmp/mysql3306.sock --concurrency=100 --iterations=5 --auto-generate-sql --auto-generate-sql-load-type=write --auto-generate-sql-add-autoincrement --engine=tokudb  --auto-generate-sql-write-number 1000000 --debug-info
Enter password: 
Benchmark
    Running for engine tokudb
    Average number of seconds to run all queries: 0.084 seconds
    Minimum number of seconds to run all queries: 0.075 seconds
    Maximum number of seconds to run all queries: 0.093 seconds
    Number of clients running queries: 100
    Average number of queries per client: 0


User time 7.57, System time 39.52
Maximum resident set size 71136, Integral resident set size 0
Non-physical pagefaults 93221, Physical pagefaults 0, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 10017036, Involuntary context switches 109

测试结果让人大跌眼镜啊,单条数据插入时间tokudb引擎居然是innodb引擎的将近2倍。但是单从压缩比来看,tokudb引擎确实要好得多。单表大小tokudb引擎差不多是innodb引擎的1/2。不知道是不是跟ssd有关,测试结果与网上相传大相径庭,后续我们换普通机械硬盘做一次测试。

你可能感兴趣的:(【MySQL】InnoDB引擎TokuDB引擎对比测试)