Linux NILFS development
 help / color / mirror / Atom feed
From: Ryusuke Konishi <ryusuke-sG5X7nlA6pw@public.gmane.org>
To: users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org,
	yongkun-b/Nwfc8pyCekRP3n4FtbsiGn5s73+xxf@public.gmane.org
Subject: Re: [SPAM] Database performance is worse with (DIRECT IO)O_DIRECT
Date: Thu, 06 Aug 2009 03:16:45 +0900 (JST)	[thread overview]
Message-ID: <20090806.031645.99368317.ryusuke@osrg.net> (raw)
In-Reply-To: <00c301ca15d4$fbac8d00$f305a700$@iis.u-tokyo.ac.jp>

Hi!
On Wed, 5 Aug 2009 22:59:43 +0900, "Yongkun Wang" wrote:
> hi, guys
> 
> I have been using this awesome file system for a while.
>
> I built a database server on it. The transaction throughput on
> NILFS2 is about several times faster than that on EXT2.
>
> However, when I set the flush method to DIRECT IO (O_DIRECT), the
> database performance on NILFS2 is even worse than that on EXT2 with
> DIRECT IO.

Interesting results.

Nilfs2 is actually not yet supporting O_DIRECT write because the core
routine of direct IO is not available for copy-on-write filesystems.
It is fallen back to a buffered write for nilfs.

O_DIRECT read is OK, but I took O_DIRECT write is implied in your
case.  Do you use postgresql ?

> My conjecture is that probably the log-structured file system need a
> lot of buffer to apply changes and group the writes.

Likely reason.  You can see what's happing on the partition by using
``dumpseg'' command; it will show summary of logs for a specified
segment.  ( You can track recently written segments with ``lssu''
command )

If your conjecture is right, you will see many files and meta data
files with inode number 4, 5, and 3, are written very frequently.

> Is it also possible that the implementation of NILFS2 on DIRECT IO
> is not very efficient?
>
> Before I read the code, could you give me some hints why the
> performance is not good with DIRECT IO?

Yes, as I mentioned above.

I think we can add native support of O_DIRECT to nilfs, but I suspect
there is a influential difference in how to flush out data between the
native direct-io and the fall-backed buffered write & sync; we may be
able to improve performance without the native o-direct support.


> Or could you please introduce the implementation relevant to the
> DIRECT IO?

Roughly speaking, I think the current nilfs implementation of O_DIRECT
leads to the same action as O_DSYNC.  To be exact, we need to analyze
the disk with the dumpseg or trace internal functions because the
behavior depends on the environment.

Cheers,
Ryusuke Konishi

      reply	other threads:[~2009-08-05 18:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-05 13:59 [SPAM] Database performance is worse with (DIRECT IO)O_DIRECT Yongkun Wang
2009-08-05 18:16 ` Ryusuke Konishi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090806.031645.99368317.ryusuke@osrg.net \
    --to=ryusuke-sg5x7nla6pw@public.gmane.org \
    --cc=users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org \
    --cc=yongkun-b/Nwfc8pyCekRP3n4FtbsiGn5s73+xxf@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox