On Wed, Apr 15, 2009 at 07:39:13PM +0200, Kees Nuyt wrote:
> On Wed, 15 Apr 2009 14:28:45 +0800, ??????
> <sky...@gmail.com> wrote:
> > I did some test  about MySQL's Insert performance 
> > on ZFS,  and met a big performance problem,
> > *i'm not sure what's the point*.

Q1: Did you set the filesystem's recordsize to match MySQL/InnoDB's page
    size?

    If not, then try doing so (and re-create/copy the DB files to ensure
    they get the new recordsize).

Q2: Did you disable the ZIL?  If so then do re-enable it.

> [snip performance and config info]
> 
> >Is there any one can help me, 
> >why fsync on zfs is so bad? 
> >or other problem?
> 
> My guess:
> The InnoDB engine uses copy-on-write internally.
> zfs adds another layer of copy-on-write. Both try to
> optimize localization (keep related data close on the disk).
> 
> Amongst other things this fight between the two causes
> fragmentation.

I doubt that's the problem.  On ZFS fsync() would mean syncing more than
just the writes to the given file, rather: all the pending writes.  To
make that go faster ZFS has the ZIL as a way to avoid having to commit
an entire ZFS transaction.  But even so writes to the ZIL are
synchronous.  If fsync()s are too slow even with the ZIL enabled then
you should put the ZIL on a write-biased flash device if at all
possible.

> Performance will get better if someone designs a MySQL
> storage engine which is aware of zfs and uses zfs
> copy-on-write primitives.

That may be, but I don't believe that two layers of COW will cause
problems in this case.  See my questions above.

Nico
-- 
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to