Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 :

Also, to understand the capabilities of limits.conf you can read this short post :

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.