Memory usage across multiple jails

Andrew Snow andrew at modulus.org
Tue Jun 23 21:17:58 UTC 2009


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


More information about the freebsd-jail mailing list