Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


MYSQL on Fedora 12 64 bit with EXT4 drive causes slow down

Posted on 2011-05-10
Medium Priority
Last Modified: 2012-05-11
We recently have been upgrading our development environment to Fedora Core 12.

We ran into a known issue with mysql on an EXT4 partition and I need to find out how to edit my fstab to boot correctly and to optimize mysql.

First off the issue we see.

When we are running on the same OS with the same mysql, and on the same hardware. The only difference is that the fast server's database is located on an EXT3 partition and the slow server has the database on an EXT4 partition.

I have done some research on the issue and it seems the cause is EXT4 and many people have given their opinion about settings for mounting the drive.

Below I attached my fstab configuration. When I tried to make these additions to the fstab the server didn't come back up.

errors=remount-ro,noatime,nodiratime,data=writeback,barrier=0,nobh,commit=100,nouser_xattr 0 1

The drives are Hardware RAID 1 mirror.
Fedora sees the drives and an LVM
it is formatted with EXT4.

Question: How should my fstab read for the / to utilize the barrier=0 and noatime settings.
Question: How should I best mount EXT4 drives in fstab.

# /etc/fstab
# Created by anaconda on Thu Apr 28 08:57:26 2011
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
/dev/mapper/vg_webdev3-lv_root /                       ext4    defaults        1 1
UUID=26fbbb79-a246-4d88-a22d-f9ec726d9772 /boot                   ext4    defaults        1 2
/dev/mapper/vg_webdev3-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

Open in new window

Question by:pjinlaok
  • 4
  • 2
LVL 38

Expert Comment

ID: 35732369
> /dev/mapper/vg_webdev3-lv_root /    ext4    defaults        1 1
change this line in /etc/fstab to (replace "defaults" with the options you get fron internet)

/dev/mapper/vg_webdev3-lv_root /   ext4   nodiratime,noatime,data=writeback,barrier=0,nobh,errors=remount-ro 1 1

Then as root
# mount -o remount /

# mount
to verify if those mount mount option applied or not.
LVL 38

Expert Comment

ID: 35732386
> How should I best mount EXT4 drives in fstab.
Or how can you mount / at boot up?
Or your question is should use EXT4 or EXT3?

Author Comment

ID: 35734260
These are the fstab entries
/dev/mapper/vg_webdev3-lv_root /                       ext4    errors=remount-ro,noatime,nodiratime,data=writeback,barrier=0,nobh,commit=100,nouser_xattr 0 1
UUID=26fbbb79-a246-4d88-a22d-f9ec726d9772 /boot                   ext4    defaults        1 2
/dev/mapper/vg_webdev3-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

This made no difference to the speed of the inserts in our mysql database.

This has been very difficult to diagnose what is causing the slowness.

How can I tell what part of mysql inserts are slowing down on EXT4?
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 38

Expert Comment

ID: 35734286
what's you mount command output now?
mount | grep vg_webdev3-lv_root

Author Comment

ID: 35734392
I ran the mount command:

This is the output

/dev/mapper/vg_webdev3-lv_root on / type ext4 (rw,noatime,nodiratime,errors=remount-ro,data=writeback,barrier=0,nobh,commit=100,nouser_xattr)
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)
/dev/sda1 on /boot 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)
LVL 38

Accepted Solution

wesly_chen earned 2000 total points
ID: 35734633
It sounds odd.

Have you compared the "defaults" option with "optimized option" on ext4?
I mean use default option and run a couple of sql queries. Record the time.
Then change to "optimized option" (reboot to make sure it take effect) then run the same set of queries.
Compare the time elapsed.

You should see some performance difference (specially barrier=0).

By the way, here is the URL has detail tuning on filesystem and MySQL (you might read before)

It seems that ext4 improves the data safety but has some performance hit.
The worse case is that you might backup you db and downgrade to ext3.....

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question