Trying to limit cpu usage of apache using cpulimit, but I can see it still going over my limit

StackOverflow https://stackoverflow.com/questions/22417562

문제

I'm trying to limit all pids under apache2 by using cpulimit.

I've tried specifically calling each individual pid with:

sudo cpulimit -p 6183 -b -l 20

It tells me it has detected the process, but when I used htop I can see the process going well over 20%.

Why is this, and is there a better way in limiting all of the apache and mysql process without targeting each pid?

도움이 되었습니까?

해결책

Have you tried cgroups, it allows you to control the CPU usage, amongst other things? http://en.wikipedia.org/wiki/Cgroups. In addition you might see it go over 20% because you have a multi core system.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top