RFE: Server Resource Limits

I'm marking this RFE as high severity because this is arguably a big gaping hole in Virtualmin system stability. Fortunately, it's also something that can probably be resolved with a few simple additions, since most of the groundwork is already in place.

Virtualmin is by definition a shared system. In any shared system, there have to be measures in place to protect users from stepping on each other or compromising the entire system. Virtualmin does a good job of protecting the obvious resources: disk space (quotas) and bandwidth. However, it does almost nothing to protect other system resources, such as CPU and memory. I have experienced this directly on one of my systems as I posted here:

http://www.virtualmin.com/forums/virtualmin/limit-php-processes-per-doma...

My post was regarding one user generating enough PHP processes to bring a system to its knees and essentially cause a DoS (not intentionally in this case) that brought down all of the other hosted domains on that system. However, this issue is more general than PHP alone. There should be a reasonable limit on any given user and/or domain to prevent them from running too many processes, consuming too much memory, etc. Fortunately, there are several methods for this already built into most Unix/Linux systems, including using the PAM limit module, and the ulimit shell command (built-into bash). These web links go into more detail:

How to: Prevent a fork bomb by limiting user process
http://www.cyberciti.biz/tips/linux-limiting-user-process.html

Limiting the number of user processes under Linux (or how I learned to stop worrying and love the fork bomb)
http://rg03.wordpress.com/2007/05/12/limiting-the-number-of-user-process...

SECURITY Limit User Processes
http://gentoo-wiki.com/SECURITY_Limit_User_Processes

Setting Shell Limits for the Oracle User
http://www.puschitz.com/TuningLinuxForOracle.shtml#SettingShellLimitsFor...

Lastly, note that the web hosting company Joyent (which uses Virtualmin) already implements these resource limits, but they must be doing it outside of Virtualmin. See here:

http://wiki.joyent.com/shared:kb:account-limits.#server-resource-caps

Thanks,
Alan

Status: 
Closed (fixed)