数据库
首页 > 数据库> > 为什么mysql 5.5比5.1慢(linux,使用mysqlslap)

为什么mysql 5.5比5.1慢(linux,使用mysqlslap)

作者:互联网

my.cnf(5.5和5.1是一样的):

back_log=200
max_connections=512
max_connect_errors=999999
key_buffer=512M
max_allowed_packet=8M
table_cache=512
sort_buffer=8M
read_buffer_size=8M
thread_cache=8
thread_concurrency=4
myisam_sort_buffer_size=128M
interactive_timeout=28800
wait_timeout=7200

mysql 5.5:

..mysql5.5/bin/mysqlslap -a --concurrency=10 --number-of-queries 5000 
      --iterations=5 -S /tmp/mysql_5.5.sock --engine=innodb
Benchmark
        Running for engine innodb
        Average number of seconds to run all queries: 15.156 seconds
        Minimum number of seconds to run all queries: 15.031 seconds
        Maximum number of seconds to run all queries: 15.296 seconds
        Number of clients running queries: 10
        Average number of queries per client: 500

mysql5.1:

..mysql5.5/bin/mysqlslap -a --concurrency=10 --number-of-queries 5000 
      --iterations=5 -S /tmp/mysql_5.1.sock --engine=innodb
Benchmark
        Running for engine innodb
        Average number of seconds to run all queries: 13.252 seconds
        Minimum number of seconds to run all queries: 13.019 seconds
        Maximum number of seconds to run all queries: 13.480 seconds
        Number of clients running queries: 10
        Average number of queries per client: 500

为什么mysql 5.5比5.1慢?

BTW:我试过mysql5.5 / bin / mysqlslap和mysql5.1 / bin / mysqlslap,结果是一样的

解决方法:

您可能会发现这一点令人惊讶,但MySQL 5.1在某些情况下可能会胜过MySQL 5.5.

Percona performed a bake-off among multiple releases of MySQL

> MySQL 4.1
> MySQL 5.0
> MySQL 5.1(内置InnoDB)
>带有InnoDB插件的MySQL 5.1
> MySQL 5.5
> MySQL 5.6

所有测试都是在MySQL未配置的情况下进行的(换句话说,没有制作my.cnf).结果?

> MySQL 4.1执行最好的单线程
>带有InnoDB插件的MySQL 5.1在多个内核上的扩展性优于5.1 InnoDB,5.5和5.6

如果您希望更新版本的MySQL能够更好地运行,您必须调整它.实际上,I described in the DBA StackExchange the idea of performing a MySQL Bakeoff.

我的意思是什么呢?

在MySQL 5.5中,有新的InnoDB选项可用于使用更专用的读线程,写线程和总体I / O容量.这可以吸引多核服务器中的更多CPU.在未配置的情况下,MySQL 5.5将在相同级别的竞争环境中运行,在大多数情况下,作为旧版本的MySQL运行.有时,它可能会表现得更糟.

标签:mysql,mysql-5-5,mysql-5-1
来源: https://codeday.me/bug/20190805/1589232.html