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

Re: Limiting Memory Use Per Process/User



Hello!

You may use
a) something like RLimitMEM 200000000 interla in your apache conf, e.g.
in <virtualhost ..>
b) Suexec limits, in case you are using suexec (user/group within
<virtualhost>)

cat /etc/apache/suexec.limits
# please refer to pam limits documentation in order to
# configure correctly these values

#<domain>        <type>  <item>  <value>
*               -       cpu                 1
*               -       as              20480
*               -       nproc             15
*               -       priority          5

HTH,
Andreas

Andreas John
net-lab GmbH
Luisenstrasse 30b
63067 Offenbach
Tel: +49 69 85700331

http://www.net-lab.net


Marcin Owsiany schrieb:
> On Tue, May 03, 2005 at 11:44:13PM -0700, Stephen Le wrote:
> 
>>I was wondering if there was a way to limit the amount of memory used
>>by any single process or user. I'd like to prevent Apache (and other
>>server daemons) from consuming all available memory and thrashing my
>>disk when everything else is forced to swap.
> 
> 
> Note that resource limits (ulimit etc) won't prevent that. Instead, they
> will just cause apache to abort with an "out of memory" error. There
> would have to be a resource limiting mechanism internal to apache, and
> PHP, in this case, to provide such thing. I don't believe there are
> such, though. FWIW, java has something closest to this, as you can
> fine-tune the garbage collector and heap sizes, at least in Sun's
> implementation.
> 
> Marcin



Reply to: