Date: Thu, 14 Oct 2004 16:27:38 +0200 (CEST) From: Oliver Fromme <olli@lurza.secnetix.de> To: freebsd-hackers@FreeBSD.ORG Subject: NFS + VM question Message-ID: <200410141427.i9EERcTF056740@lurza.secnetix.de>
next in thread | raw e-mail | index | archive | help
Hi, I'm currently trying to optimize some NFS mounts. I have a server machine (which is an NFS client) which contains multiple chroot environments. I'm mounting the same direc- tory from an NFS server multiple times at different mount points (i.e. one per chroot). There are daemons and other programs running from those NFS directories. Now my question is: If the same daemon is running multiple times within those chroot environments, does the FreeBSD kernel recognize that it is actually the same binary on the NFS server, therefore share the executable and libraries in memory? Or will the executable and libs end up duplicated in memory? When running stat(1) on a multiply mounted executable, the inode numbers are the same, but the minor device numbers are different, so maybe they canot be shared: File: "/chroot/one/bin/httpd" Device: 255,33554437 Inode: 2268790 Links: 1 File: "/chroot/two/bin/httpd" Device: 255,33554439 Inode: 2268790 Links: 1 File: "/chroot/one/bin/httpd" Device: 255,33554458 Inode: 2268790 Links: 1 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? 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. Thanks in advance! Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. (On the statement print "42 monkeys" + "1 snake":) By the way, both perl and Python get this wrong. Perl gives 43 and Python gives "42 monkeys1 snake", when the answer is clearly "41 monkeys and 1 fat snake". -- Jim Fulton
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410141427.i9EERcTF056740>