From owner-freebsd-jail@FreeBSD.ORG Tue Jun 23 21:17:58 2009 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C331106564A for ; Tue, 23 Jun 2009 21:17:58 +0000 (UTC) (envelope-from andrew@modulus.org) Received: from email.octopus.com.au (email.octopus.com.au [122.100.2.232]) by mx1.freebsd.org (Postfix) with ESMTP id D1FCF8FC0A for ; Tue, 23 Jun 2009 21:17:57 +0000 (UTC) (envelope-from andrew@modulus.org) Received: by email.octopus.com.au (Postfix, from userid 1002) id 2298B174DF; Wed, 24 Jun 2009 07:18:21 +1000 (EST) X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on email.octopus.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=10.0 tests=ALL_TRUSTED autolearn=failed version=3.2.3 Received: from [10.1.50.60] (ppp121-44-41-14.lns10.syd7.internode.on.net [121.44.41.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: admin@email.octopus.com.au) by email.octopus.com.au (Postfix) with ESMTP id EEF3817348; Wed, 24 Jun 2009 07:18:16 +1000 (EST) Message-ID: <4A41461D.4000009@modulus.org> Date: Wed, 24 Jun 2009 07:16:13 +1000 From: Andrew Snow User-Agent: Thunderbird 2.0.0.14 (X11/20080523) MIME-Version: 1.0 To: Tom Haapanen References: <0c1201c9f43e$166c8450$43458cf0$@com> In-Reply-To: <0c1201c9f43e$166c8450$43458cf0$@com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-jail@freebsd.org Subject: Re: Memory usage across multiple jails X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 21:17:58 -0000 Tom Haapanen wrote: > I am wondering whether there are any comparative > efficiencies in memory utilization. Will the jails share the disk cache, > for example, or does each jail allocate its own? Will other kernel > structures (and code!) be shared across jails, or allocated multiple times? > And what about userland applications, like httpd, for example? (I suspect > userland would not be able to benefit, but that's just a guess.) It is extremely efficient. It is as if the host system sees a single system with the processes of all the jails running. * the jails share disk cache * jails don't have any reserved memory so any unused memory returns to the free pool of the kernel, available for disk cache * there is a single kernel shared across all jails * userland code can also be shared across jails *if* you run the code from the same set of on-disk binaries (which is not the way most people set up jails) * since there is only a single kernel all network and disk I/O from the jails goes at the same speed as the host However, VMware installations are now able to achieve the same level of efficiency using the following measures: * "transparent page sharing" stores only a single copy of shared memory pages * free and unused memory in each guest can be used by installing the vmmemctl driver (part of VMware-tools) * disk cache can be "shared" by using shared storage (NAS) * paravirtualisation drivers for disk and networking in the guest can achieve full host speed & efficiency - Andrew