Date: Sun, 13 Jan 2008 23:30:12 +0100 From: Jeremie Le Hen <jeremie@le-hen.org> To: Andrew Snow <andrew@modulus.org> Cc: freebsd-jail@freebsd.org Subject: Re: Jails as a VPS Message-ID: <20080113223012.GC27473@obiwan.tataz.chchile.org> In-Reply-To: <47841D07.20902@modulus.org> References: <47841D07.20902@modulus.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Andrew, On Wed, Jan 09, 2008 at 12:01:59PM +1100, Andrew Snow wrote: > I am running a hoster providing "VPS" using FreeBSD Jails on 6.2 > > FYI, I have patched my kernel in several places to make it work for me: > * jails have their own SYSV shared memory and semaphores > * per-jail number of processes limit > * jail ability to be bound to a given CPU core > * jails have a limited range of nice values (10 to -10) compared to the > host environment > > and last but not least: > * memory usage measurement and limiting. > > It is this last one that is causing me the most problems. I modified > obreak() to deny requests for more memory when memory limit is exceeded, and > that works OK. > > But measuring the jail memory usage in the first place is proving to be a > pain, and I wonder if you guys have any ideas. > > I am doing something similar to the Google SoC, by measuring the resident > page count of every VM map held by every process in the jail. > > This does not measure memory fairly - it counts shared memory too many > times. To see this in action, I can allocate a jail with 500mb memory limit > then try to start 10 or 20 large apache HTTPD processes. While using only a > small amount of actual system ram (under 100mb probably), it measures it to > be much larger. > > I am now looking at adding fields to VM memory maps and tagging them so I > can ensure I don't count them twice, but this is starting to get > non-trivial. > > Anyone else been able to solve this problem or have any better knowledge? Congratulations for your work. Any chance to disclose it? Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080113223012.GC27473>