[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: resource limits



On Fri, Nov 03, 2000 at 05:56:09PM +0800, Mailing List wrote:
| Actually, I have a related question.
| 
| We offering web hosting to our clients. When people run huge CGIs, normally
| we are notified, and kill them manually. We've also got a small script we
| run periodically to kill of any "stuck" or "hanged" processes by users' cgis
| (we use suexec so they run under their usernames).
| 
| HOWEVER, as this is a reactive measure, rather than a PROactive measure,
| we'd rather have a way of LIMITING their usage like we do diskspace.
| 
| By putting it in the /etc/init.d/apache script, it would limit the apache
| server as well (www-data) user, and thats bad. We ONLY want to limit the
| user's cgi processes. We haven't founded any script that suexec uses to run
| user cgis, so we can't limit it that way.
| 
| Any ideas???
| 
| Thanks in advance.
[.. snipp ..]

We use suexec and this config in httpd.conf

<VirtualHost 111.111.11.11>
	DocumentRoot /usr/local/apache/htdocs/bikeshop
	User bikeshop
	Group users
	RLimitCPU 30 30
	RLimitMEM 50000000 50000000
	ScriptAlias /cgi-bin/ /usr/local/apache/htdocs/bikeshop/cgi-bin/
</VirtualHost>

References:
http://www.apache.org/docs-1.2/mod/core.html#rlimitcpu
http://www.apache.org/docs-1.2/mod/core.html#rlimitmem
http://www.apache.org/docs-1.2/mod/core.html#rlimitnproc

-- 
Fredrik Steen
%{-------------------+
 | <fsteen@stone.nu> |
 | +46 (0)54 7756212 |
 +-------------------%}




Reply to: