NFS + VM question

David Malone dwmalone at maths.tcd.ie
Fri Oct 15 05:50:03 PDT 2004


On Thu, Oct 14, 2004 at 04:27:38PM +0200, Oliver Fromme wrote:
> On the other hand, the kernel should know that the mounts
> come from the same NFS source, so it might actually be able
> to handle it efficiently (i.e. share).  But I really don't
> know.  Any FreeBSD kernel hacker can enlighten me?

Since the server could actually hand out different content depending
on the mount instance, I don't think the NFS client could make these
assumptions. If you try NFS mounting /usr a few times and then time
how long it takes to cat a cached file, you'll see this.

> If the memory isn't shared in this situation, is there a
> way to change the design so it can be shared?  chroot and
> NFS are "musts", though.

I don't think there is an easy way to get this caching to happen,
short of using hard links or some kind of union mount instead of
NFS.

	David.

> /usr/bin/time cat /usr/X11R6/bin/Xvfb > /dev/null
        0.17 real         0.00 user         0.03 sys
> /usr/bin/time cat /usr/X11R6/bin/Xvfb > /dev/null
        0.02 real         0.00 user         0.02 sys
> /usr/bin/time cat /usr/X11R6/bin/Xvfb > /dev/null
        0.02 real         0.00 user         0.02 sys
> /usr/bin/time cat /mnt1/X11R6/bin/Xvfb > /dev/null
        0.21 real         0.00 user         0.04 sys
> /usr/bin/time cat /mnt1/X11R6/bin/Xvfb > /dev/null
        0.03 real         0.00 user         0.03 sys
> /usr/bin/time cat /mnt1/X11R6/bin/Xvfb > /dev/null
        0.03 real         0.00 user         0.02 sys
> /usr/bin/time cat /mnt2/X11R6/bin/Xvfb > /dev/null
        0.21 real         0.00 user         0.04 sys
> /usr/bin/time cat /mnt2/X11R6/bin/Xvfb > /dev/null
        0.03 real         0.00 user         0.03 sys
> /usr/bin/time cat /mnt2/X11R6/bin/Xvfb > /dev/null
        0.03 real         0.00 user         0.03 sys
> /usr/bin/time cat /mnt3/X11R6/bin/Xvfb > /dev/null
        0.21 real         0.00 user         0.04 sys
> /usr/bin/time cat /mnt3/X11R6/bin/Xvfb > /dev/null
        0.03 real         0.00 user         0.03 sys
> /usr/bin/time cat /mnt3/X11R6/bin/Xvfb > /dev/null
        0.03 real         0.00 user         0.03 sys



More information about the freebsd-hackers mailing list