— Yeah, just that simple question. It's too easy to consume a lot of RAM in brain-dead mod_XxX (say, mod_php
) application, so I'm just wondering what does Apache allow to do as countermeasure.
— Yeah, just that simple question. It's too easy to consume a lot of RAM in brain-dead mod_XxX (say, mod_php
) application, so I'm just wondering what does Apache allow to do as countermeasure.
Apache doesn't, but PHP does allow limiting the maximum amount of memory used, in php.ini. For instance:
Of course if someone hits this limit the actual amount of RAM used will be slightly higher due to PHP being embedded into Apache.
The
ulimit
shell feature (which uses thesetrlimit
system feature) can limit per-process memory use.http://feeding.cloud.geek.nz/posts/putting-limit-on-apache-and-php-memory/
See also
I deem it should be considered answered with exactly this quote from the comments: "There isn't one (solution). It depends entirely on the modules you are using" © Michael Hampton