[mythtv-users] Performance issues with ext4

f-myth-users at media.mit.edu f-myth-users at media.mit.edu
Mon Dec 28 04:42:36 UTC 2009

    > Date: Sun, 27 Dec 2009 22:45:09 -0500
    > From: Boleslaw Ciesielski <bc-mythtv at comcast.net>

    > On 12/27/09 14:55, Daniel Kristjansson wrote:
    > > On Sun, 2009-12-27 at 14:45 -0500, Daniel Kristjansson wrote:
    > >> I sounds like you had performance issues with mysql on ext4.
    > >> I'm not aware of any such problems which are not shared by ext3.
    > >
    > > Let me correct myself, found something that said barrier mode could
    > > cause a severe performance regression. mount with barrier=0 to avoid
    > > this, but I don't know if that is really a good idea..

    > Thanks, I found this

    > http://ubuntuforums.org/showthread.php?t=1313834
    > http://bugs.mysql.com/bug.php?id=46959

    > which basically describes (probably) the same issue. Still, I don't know 
    > what the implications are either...

The implications are potentially dire, but depend on you being
unlucky, and have to do with the behavior of the filesystem if
you lose power at the wrong moment.

Barriers are designed to make sure that data committed to the disk
actually gets there in a particular sequence, but the performance hit
for enabling them by default in ext3 was deemed unacceptable, even
though a quick break-your-filesystem test case was devised. [1]

ext4 enabled them by default.  Unfortunately, -somebody- is going to
have to get ext4 and mysql to play nicely about this.

For more controversy about this then you have the patience to read,
see [2] and [3].  There's a summary of some of these issues at [4].
Most of [2] and [3] concern the semantics of fsync and don't have
to do with barriers per se, but they'll explain to you the problems
here and why the right thing might be a subtle interaction between
any given filesystem and any given application.

(I've known tytso for a couple of decades.  I trust his judgment here
implicitly.  But I haven't specifically asked him about ext4 barriers
vs mysql and what the right long-term solution to this might be.  The
short-term solution, in any extfs, might be to make sure mysql is on a
stable system that won't freeze or panic, and is connected to a UPS
which you have -properly- configured to warn the system in the event
of a power failure.)

[1] http://article.gmane.org/gmane.comp.file-systems.ext4/6702
[2] http://thunk.org/tytso/blog/2009/03/12/delayed-allocation-and-the-zero-length-file-problem/
[3] http://thunk.org/tytso/blog/2009/03/15/dont-fear-the-fsync/
[4] http://lwn.net/Articles/283161/

More information about the mythtv-users mailing list