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

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

Who is Participating?
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.....
> /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.
> 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?
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

pjinlaokAuthor Commented:
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?
what's you mount command output now?
mount | grep vg_webdev3-lv_root
pjinlaokAuthor Commented:
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)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.