Daire Byrne:
> I can watch the network traffic with tcpdump and see that for every
> (?) file there are lots of NFS ops (plenty of "readdirplus" for
> example) to the NFS server. The time taken to list all the files
> increases (0.4s -> 15s in my simple test). I'm wondering if it is
> possible to tell aufs never to check the NFS branch if the file exists
> on the local branch. I understand that in order to make a union the
> directory contents of the remote filesystem needs to be known but is
> there any way to minimise the traffic so that this operation is only
> done once (for each dir?). I can probably turn up the NFS attribute
> caching but this doesn't help much with the very first read.

Aufs has an option called 'rdcache=<seconds>' which specifies the
readdir cache lifetime in aufs. The default value is 10 seconds. If you
set it much longer, then you will be able to reduce the number of
internal readdir for branch FS.
But it is equivalent to the NFS cache time you mentioned. So I am afraid
you won't be satisfied.
I'd like to suggest you to try RDU (readdir in userspace) which runs
faster generally. To use RDU,
- enable CONFIG_AUFS_RDU, rebuild, and reboot.
- 'make install_ulib' under aufs2-util.git tree.
- set the environment variables,
  + LD_PRELOAD=libau.so
  + LIBAU=readdir
- read the aufs manaul.
- and run your application under aufs.
Although you may not agree, I think the NFS cache options are effective
for you too.

Aufs has no option to stop readdir for the lower branch. While you know
the contents of the upper branch is equivalent to the lower, aufs
doesn't know it. And aufs thinks there may exist unknown files on the
lower branch. It wont' be clear until aufs completes readdir for the
lower branch.

There is one related branch attribute in aufs. It is '<branch>=rr' which
stands for real readonly. But it may not be helpful for you.


> I can send you the extra debug data but I suspect that AUFS was never
> designed to be able to do what I am describing so it is not a "bug".
> Is it possible though?

Obviously it is not a bug. But I think I could understand what you want.
Currently I'd suggest you to try RDU in aufs, NFS cache options or
FS-cache. Because aufs depends upon the behaviour of branch fs, and the
behaviour you pointed out is the natural behaviour of NFS.


J. R. Okajima

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 

Reply via email to