mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Chris.Petersen@synopsys.com
Cc: jlnance@unity.ncsu.edu, linux-kernel@vger.kernel.org
Subject: Re: Awful NFS performance with attached test program
Date: Tue, 20 Jan 2004 16:50:44 -0500	[thread overview]
Message-ID: <1074635444.5368.286.camel@nidelv.trondhjem.org> (raw)
In-Reply-To: <400D897C.A5439DFE@synopsys.com>

På ty , 20/01/2004 klokka 15:03, skreiv Chris Petersen:
> In the second case, he's performing 83,886 seeks and writing 83,886
> 4-byte ints (only 1 int per seek), OVER THE SAME 400MB REGION.  As such,
> he cannot be writing to "more" ("times as many") pages in the second case
> as he does in the first.  In fact, due to the spacing of the seeks, he
> can occasionally skip over some pages.  He's simply writing over the
> same region in a more sparse, incremental-but-non-contiguous, manner.

Duh... You're right. Sorry...

> Why does Solaris take only 1.3 seconds to do what Linux takes ~10 minutes
> to do?!?
> Ironically, the "update file" section on Solaris takes LESS time than it
> does to create it...which in some ways makes sense:  The app is only writing
> 335,544 bytes in the second phase compared to 400M in the first (creation)
> phase.

2 comments:

  1) your testcase is missing an fflush() call before the gettimeofday()
in case 2

  2) In any case, fflush() does not actually ensure the data has been
written out to disk: it just schedules the writes (man 3 fflush). If you
actually want to measure write performance, you need to add fsync()
after the fflush().

So here's the difference:


-------------------------
On a Solaris machine:

Without fflush+fsync:
bash-2.05$ ./a.out
Creating file: 9.933 seconds
Updating file: 4.382 seconds

With fflush, but no fsync:
bash-2.05$ ./a.out
Creating file: 9.852 seconds
Updating file: 1.459 seconds

With fflush+fsync:
bash-2.05$ ./a.out
Creating file: 9.915 seconds
Updating file: 10.639 seconds
------------------------
Now on Linux 2.6.1-mm3:

Without fflush+fsync:
[trondmy@hammerfest gnurr]$ ./a.out
Creating file: 3.475 seconds
Updating file: 0.561 seconds

With fflush, but no fsync:
[trondmy@hammerfest gnurr]$ ./a.out
Creating file: 3.275 seconds
Updating file: 1.642 seconds

With fflush+fsync:
[trondmy@hammerfest gnurr]$ ./a.out
Creating file: 3.780 seconds
Updating file: 4.618 seconds
-----------------------------

Surprise! Linux and Solaris show exactly the same behaviour.

As I said before in 2.4.x we have a hard limit of 256 outstanding
requests before we have to wait on requests to complete. Remove that
limit, and all is well...

Cheers,
  Trond

  reply	other threads:[~2004-01-20 21:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-19 21:16 jlnance
2004-01-19 21:53 ` Trond Myklebust
2004-01-20 13:28   ` jlnance
2004-01-20 14:12     ` Trond Myklebust
2004-01-20 20:03       ` Chris Petersen
2004-01-20 21:50         ` Trond Myklebust [this message]
2004-01-21  2:01           ` jlnance
2004-01-20 20:31     ` Jan Dittmer
     [not found] <20040119211649.GA20200@ncsu.edu.suse.lists.linux.kernel>
     [not found] ` <1074549226.1560.59.camel@nidelv.trondhjem.org.suse.lists.linux.kernel>
     [not found]   ` <20040120132803.GA2830@ncsu.edu.suse.lists.linux.kernel>
     [not found]     ` <1074607946.1871.37.camel@nidelv.trondhjem.org.suse.lists.linux.kernel>
2004-01-20 14:38       ` Andi Kleen

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=1074635444.5368.286.camel@nidelv.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=Chris.Petersen@synopsys.com \
    --cc=jlnance@unity.ncsu.edu \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®