Date: Fri, 17 Jun 2005 13:57:26 -0500 From: David Sze <dsze@distrust.net> To: Matthias Buelow <mkb@incubus.de> Cc: Greg Barniskis <nalists@scls.lib.wi.us>, uzi@bmby.com, freebsd-stable@freebsd.org Subject: Re: FreeBSD MySQL still WAY slower than Linux Message-ID: <20050617185726.GD94284@mail.distrust.net> In-Reply-To: <200506171620.j5HGKxwW042819@drjekyll.mkbuelow.net> References: <20050617155938.GB94284@mail.distrust.net> <200506171620.j5HGKxwW042819@drjekyll.mkbuelow.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 17, 2005 at 06:20:59PM +0200, Matthias Buelow wrote: > David Sze <dsze@distrust.net> writes: > > >CentOS uses ext3 by default. How does having a journal help if the > >journal is stored on the same async filesystem? Unless the journal > >writes are guaranteed sync. > > The journal guarantees that the filesystem will always be consistent. If > a journal entry doesn't make it to disk, the operation has never > happened; and the journal entry won't get removed, until the metadata > update has been performed. So the worst thing that could happen is, that > the same operation will be performed twice, once normally, and once at > log replay on reboot. This is not an issue, since such metadata > operations (delete file from directory, write a value into superblock, > etc.) are usually idempotent. > > That's the basic function of all journalled filesystems, and that's why > you don't need to run fsck on them. You don't need to write the journal > synchronously, you can do these things in groups. > > The softupdates mechanism does something similar; only it doesn't > maintain an on-disk journal, and hence needs fsck after boot to fix up > the free block bitmaps and stuff (basically performing a garbage > collection on the filesystem, which, unfortunately, is pretty slow). I'm not sure filesystem consistency alone is "good enough". Say your bank's database crashes right after you make a deposit. When it comes back up it's consistent, but only up to 5 minutes before the crash due to the async mount. For this type of application, something in the system has to be keeping a "journal" on a sync mount in order for recovery to be both consistent and correct.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050617185726.GD94284>