Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2008 13:30:43 +0100
From:      Miroslav Lachman <000.fbsd@quip.cz>
To:        Andrew Snow <andrew@modulus.org>
Cc:        freebsd-jail@freebsd.org
Subject:   Re: Jails as a VPS
Message-ID:  <478B55F3.5080505@quip.cz>
In-Reply-To: <47841D07.20902@modulus.org>
References:  <47841D07.20902@modulus.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Andrew Snow wrote:
> 
> Hi Guys,
> 
> 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?

It would be nice to have those features in base FreeBSD 6/7. Can I (we) 
hope you publish your work?

Miroslav Lachman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?478B55F3.5080505>