All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Kirby <sim@hostway.ca>
To: linux-nfs@vger.kernel.org
Subject: Slower performance with lookupcache (2.6.30.2)
Date: Fri, 24 Jul 2009 16:13:00 -0700	[thread overview]
Message-ID: <20090724231300.GA572@hostway.ca> (raw)

Hello :)

I just noticed something interesting while benchmarking NFSv3 versus
GlusterFS.  With lookupcache enabled (all or positive), it seems that
successive executions of "du" are slower the second and further times. 
With lookupcache disabled, second and further executions are slightly
faster than the first but still slower than with lookupcache enabled:

# umount /nfs ; mount -t nfs 10.10.52.30:/home/nfs /nfs -o lookupcache=positive && repeat 3 /bin/sh -c 'time du -s /nfs/test ; sleep 3'
494616  /nfs/test

real    0m1.670s
user    0m0.028s
sys     0m0.344s
494616  /nfs/test

real    0m4.030s
user    0m0.052s
sys     0m0.536s
494616  /nfs/test

real    0m4.025s
user    0m0.060s
sys     0m0.608s

With lookupcache=none:

# umount /nfs ; mount -t nfs 10.10.52.30:/home/nfs /nfs -o lookupcache=none && repeat 3 /bin/sh -c 'time du -s /nfs/test ; sleep 3'
494616  /nfs/test

real    0m5.362s
user    0m0.044s
sys     0m0.924s
494616  /nfs/test

real    0m4.496s
user    0m0.060s
sys     0m0.828s
494616  /nfs/test

real    0m4.497s
user    0m0.052s
sys     0m0.780s

In this case, /nfs/test is just a copy of /usr made on the server.  The
only difference is "lookupcache".  When set to "all" or "positive", the
first sweep is much faster than "none", but the following sweeps are
slower.

nfsstat shows that "getattr" is called many more times on the second and
third sweeps:

# umount /nfs ; mount -t nfs 10.10.52.30:/home/nfs /nfs -o lookupcache=all && repeat 3 /bin/sh -c 'cat /proc/net/rpc/nfs > /tmp/x ; time du -s /nfs/test ; nfsstat -c3 -S /tmp/x ; sleep 3'
494616  /nfs/test

real    0m1.684s
user    0m0.036s
sys     0m0.316s
Client rpc stats:
calls      retrans    authrefrsh
8622       0          0       

Client nfs v3:
null         getattr      setattr      lookup       access       readlink     
0         0% 3649     42% 0         0% 820       9% 1826     21% 0         0% 
read         write        create       mkdir        symlink      mknod        
0         0% 0         0% 0         0% 0         0% 0         0% 0         0% 
remove       rmdir        rename       link         readdir      readdirplus  
0         0% 0         0% 0         0% 0         0% 8         0% 2319     26% 
fsstat       fsinfo       pathconf     commit       
0         0% 0         0% 0         0% 0         0% 

494616  /nfs/test

real    0m3.975s
user    0m0.052s
sys     0m0.672s
Client rpc stats:
calls      retrans    authrefrsh
25076      0          0       

Client nfs v3:
null         getattr      setattr      lookup       access       readlink     
0         0% 25076   100% 0         0% 0         0% 0         0% 0         0% 
read         write        create       mkdir        symlink      mknod        
0         0% 0         0% 0         0% 0         0% 0         0% 0         0% 
remove       rmdir        rename       link         readdir      readdirplus  
0         0% 0         0% 0         0% 0         0% 0         0% 0         0% 
fsstat       fsinfo       pathconf     commit       
0         0% 0         0% 0         0% 0         0% 

494616  /nfs/test

real    0m4.010s
user    0m0.056s
sys     0m0.616s
Client rpc stats:
calls      retrans    authrefrsh
25076      0          0       

Client nfs v3:
null         getattr      setattr      lookup       access       readlink     
0         0% 25076   100% 0         0% 0         0% 0         0% 0         0% 
read         write        create       mkdir        symlink      mknod        
0         0% 0         0% 0         0% 0         0% 0         0% 0         0% 
remove       rmdir        rename       link         readdir      readdirplus  
0         0% 0         0% 0         0% 0         0% 0         0% 0         0% 
fsstat       fsinfo       pathconf     commit       
0         0% 0         0% 0         0% 0         0% 

Adding "echo 1 > /proc/sys/vm/drop_caches" to the repeat loop makes the
readdirplus calls happen each time, but still with increased getattrs. 
With "echo 2 > /proc/sys/vm/drop_caches" instead, behaviour is always
fast (~1.6 seconds).

The lookupcache here seems to be increasing initial performance but then
seems to slow down cached performance by causing more getattrs than with
no lookupcache, perhaps for revalidation tests.

This is stock 2.6.30.2 on the server and client, NFSv3, EXT3 on the
server.

Simon-

             reply	other threads:[~2009-07-24 23:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-24 23:13 Simon Kirby [this message]
2009-07-25 16:51 ` Slower performance with lookupcache (2.6.30.2) Trond Myklebust
2009-07-27 17:01   ` Simon Kirby
2009-07-27 21:57     ` Trond Myklebust

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=20090724231300.GA572@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.