I've got a php/linux web site. My php processes periodically need to run executables to do things like manipulate images. I'd like to limit the amount of memory and CPU those sub-processes can consume, but I'd like for the limits to be different than what my php processes are limited to. What is the simplest way to accomplish that?

Thanks!

link|improve this question
feedback

2 Answers

I would use a different user dedicated for running commands and sudo to run all commands as that user. To set the limits for an user you can use pam_limits.

link|improve this answer
feedback

There are several ways to do that, but i've just used one:

Edit /etc/security/limits.conf ;)

Check this link : http://www.gentoo.org/doc/en/security/security-handbook.xml?part=1&chap=5#doc_chap1

Also, to understand the capabilities of limits.conf you can read this short post : http://www.cyberciti.biz/tips/linux-limiting-user-process.html

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.