Jails as a VPS

Jeremie Le Hen jeremie at le-hen.org
Sun Jan 13 15:05:48 PST 2008


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 >


More information about the freebsd-jail mailing list