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

Posted on 2011-05-10
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
    LVL 38

    Expert Comment

    > /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

    > 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

    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?
    LVL 38

    Expert Comment

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

    Author Comment

    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

    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

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
    Lets start to have a small explanation what is VAAI(vStorage API for Array Integration ) and what are the benefits using it. VAAI is an API framework in VMware that enable some Storage tasks. It first presented in ESXi 4.1, but only after 5.x sup…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now