From: Simon Kirby <sim@hostway.ca>
To: linux-nfs@vger.kernel.org
Subject: Write on close behaviour versus slow media and slow network
Date: Tue, 14 Apr 2009 17:48:09 -0700 [thread overview]
Message-ID: <20090415004809.GC17195@hostway.ca> (raw)
Hello!
I have a usual process of downloading pictures from a flash card (@ 15
MB/s or so) and writing them over 100 Mbps Ethernet (@ 12 MB/s or so).
One would expect and hope that both the reading and writing could happen
simultaneously to optimize throughput, but the current behaviour on both
NFSv3 and NFSv4 is as follows:
multiple files loop (copying with "cp"):
open source, dest
data copy loop:
read(source)
write(dest)
close(source)
close(dest)
The inner loop happens at about the rate of the flash card reader all the
way up to my picture size (12-25 MB). Then, on close(), rpciod / the NFS
client flushes all data over the network, at the rate which the network
can sustain.
Overall throughput is therefore about 1/(1/12+1/15) == 6.67 MB/s, which
is not very exciting.
I find that replacing "cp" with "dd ... bs=131072 oflag=dsync" lets me
copy at near network speed, at the expense of slowing down copying to a
local hard drive should I chose to do that instead, and seems to be more
of a workaround than a solution (and it's very sensitive to block size
and still slower than network speed).
Is there any way to convince NFS (or buffer flushing) to start sooner in
this case -- preferrably when there are at least wsize bytes available to
write? Is there any downside to doing this?
Other than some special-case handling with deleting a temporary file
before closing it (does that even work?), I don't see how the current
behaviour helps performance in _any_ case, even when copying from fast
media.
I looked around the NFS man pages, /proc and /sys and didn't see anything
that might be helpful, but I am interested to find out how things came to
arrive at this implementation.
Cheers!
Simon-
next reply other threads:[~2009-04-15 0:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-15 0:48 Simon Kirby [this message]
2009-04-15 14:29 ` Write on close behaviour versus slow media and slow network Chuck Lever
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=20090415004809.GC17195@hostway.ca \
--to=sim@hostway.ca \
--cc=linux-nfs@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