Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?


share|improve this question

2 Answers 2

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.

share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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