0

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!

twk
  • 125
  • 1
  • 1
  • 6

2 Answers2

0

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.

Mircea Vutcovici
  • 17,619
  • 4
  • 56
  • 83
0

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

Marc Riera
  • 1,637
  • 4
  • 23
  • 38