MySQL Forums
Forum List  »  Install & Repo

MySQL is running 8,000% slower on CentOS 6x than CentOS 5x. Maybe ext4 related?
Posted by: Michael Reed
Date: July 01, 2013 01:38PM

MySQL runs great under CentOS 5.9, yet runs 80 times slower on CentOS 6.4.

To test the difference, I did brand new CentOS installations on a physical (not VPS) computer. When installing CentOS, I made no changes from the default settings, made no configuration changes, only installed MySQL using yum install mysql-server, and then did mysql_secure_installation. I then created a very simple script which creates 40 tables and inserts 5 rows in each table, and then did the following:

Centos 5.9 with yum installed MySQL 5.0.95

[root@desktop ~]# time mysql -uroot -pMyPassword < test.sql
real 0m0.112s
user 0m0.008s
sys 0m0.005s


Centos 6.4 with yum installed MySQL 5.1.69

[root@desktop ~]# time mysql -uroot -pMyPassword < test.sql
real 0m8.140s
user 0m0.012s
sys 0m0.009s

Went from 0.112 seconds to 8.140 seconds! The reason for the different MySQL versions is CentOS repositories 5 and 6 have different versions.

To ensure it wasn't hardware related, I've done these tests on two computers; one a 7 year old laptop and the second a brand new desktop. I've tried CentOS 6.3 and found that it reacts the same as CentOS 6.4, and tried CentOS 5.8 and found that it reacts the same as CentOS 5.9 In addition to installing MySQL using yum with CentOS's repository, I also tried MySQL 5.5 using yum with IUS's repository as well as MySQL 5.6 using RPM directly from MySQL, however, had no change in performance.

I then tried setting innodb_flush_log_at_trx_commit = 0, and and performance improved, but was still 40x slower than MySQL under CentOS 5X.

I then added option barrier=0 to fstab, and improved performance, but am still about 4 times slower than CentOS 5x. See below how I did this, and the results I experienced.

[root@desktop ~]# mount
/dev/mapper/vg_localhost-lv_root on / type ext4 (rw,barrier=0)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sdb1 on /boot type ext4 (rw)
/dev/mapper/vg_localhost-lv_home on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
[root@localhost NotionCommotion]#

[root@desktop ~]# time mysql -uroot -pmyPassword < test.sql

real 0m0.455s
user 0m0.006s
sys 0m0.006s
[root@desktop ~]#


Is this a bug in mysql? Reference http://bugs.mysql.com/bug.php?id=46959. Should MySQL never run under ext4?

I have posted a similar message at CentOS's forum, but haven't heard back. If I do, I will post results here.

Please help

Options: ReplyQuote


Subject
Written By
Posted
MySQL is running 8,000% slower on CentOS 6x than CentOS 5x. Maybe ext4 related?
July 01, 2013 01:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.