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

Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top