Linux NFS development
 help / color / mirror / Atom feed
From: Frank Steiner <fsteiner-mail1@bio.ifi.lmu.de>
To: linux-nfs@vger.kernel.org
Subject: Parallel file locking quite slow with vers=4.0 compared to vers=3
Date: Mon, 20 Jul 2015 16:02:01 +0200	[thread overview]
Message-ID: <55ACFF59.7040707@bio.ifi.lmu.de> (raw)

Hi,

we ran into this when opening about a dozen "xterm ...&"  in an ~/.xinitrc on
a diskless client with /var mounted with NFS. The xterms popup one after
another and sometimes it takes up to 7 or 8 seconds until they are all
available.

This works without any noticeable delay as long as /var was exported/mounted
with NFSv3. After switching to NFSv4 the delay showed up. It's caused
by the utempter processes called by xterm that are trying to write
(and thus lock) to /var/log/wtmp in parallel.

Making some little test with a c program doing nothing but 
"fcntl (fd, F_SETLKW, &lck);" with "lck.l_type = F_WRLCK" it turned out
that executing ten instances of this program on a NFSv3 share work
within one second, while on a NFSv4 share about 5 or 6 return immediately,
the remaining finish after up to 3 seconds. The more instances we
exec the more are delayed and the delays are getting bigger.

With NFSv4 shares this always happens.
If the server exports with NFSv3, it matters which value for vers= 
the client uses. We mounted the same nfs3-export once with "vers=3" 
and once with "vers=4.0" on the same client. The test on the vers=3 
mount shows no delays even with 20 parallel runs, the vers=4.0 mount 
has the delays.

I guess this is some kind of flodding protection for parallel operations,
but can it be tweaked on the server or the client side somehow? Apart
from the xinitrc setting we have some other (weird :-)) scenarions where
this delay are ugly and we would be happy to get rid of them (while still
using NFSv4).

cu,
Frank

-- 
Dipl.-Inform. Frank Steiner   Web:  http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik    Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17           Phone: +49 89 2180-4049
80333 Muenchen, Germany       Fax:   +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *

             reply	other threads:[~2015-07-20 14:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 14:02 Frank Steiner [this message]
2015-07-20 21:23 ` Parallel file locking quite slow with vers=4.0 compared to vers=3 J. Bruce Fields
2015-07-21  6:44   ` Frank Steiner
2015-07-21 15:51     ` J. Bruce Fields
2015-07-22 14:49       ` Frank Steiner
2015-07-22 14:53         ` Frank Steiner
2015-07-22 15:40           ` J. Bruce Fields

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=55ACFF59.7040707@bio.ifi.lmu.de \
    --to=fsteiner-mail1@bio.ifi.lmu.de \
    --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