Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 want to limit CPU and memory usage for PHP-FPM and Nginx processes in CentOS. I came across following tools

  • cpulimit
  • cggroups
  • memory resource locater

which will more efficient and how can I configure for limiting resources for PHP-FPM and Nginx processes ?

share|improve this question
up vote 1 down vote accepted

I think "cpulimit" is best way to control cpu usage per process. cpulimit does not act on the nice value or other scheduling priority stuff, but on the real cpu usage.


Install cpulimit on Linux:

yum install cpulimit

To limit CPU usage of the process called nginx to 40%, enter:

cpulimit -e nginx -l 40

To limit CPU usage of the process to 40% by using its PID, enter:

cpulimit -p 3302 -l 40


-p : Process PID. -e : Process name. -l : percentage of CPU allowed from 0 to 100. -P: absolute path name of the executable program file.

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.