Results 1 to 3 of 3
Thread: Limit a processes CPU
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Dec 2010
Limit a processes CPU
It turned out that we were apparently using too much CPU and it was lagging other VPSs. I'm a little confused about that because I thought that we had our own reserved CPU and we couldn't use any more than that.
Anyways I'm looking for a program that can limit a process's CPU, and doesn't do it by killing that process.
- Join Date
- Apr 2009
- I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
There is (generally) no such thing as a reserved CPU in Linux. CPU time slices are scheduled as needed by processes that are ready to run and not blocked on I/O (disc, network, etc). A single-threaded application can only use one CPU at a time. Most processes work at the same priority. However, if you find that one process is using too much CPU resources, then you can either increase its nice factor, or raise its priority number (higher number, lower priority). That will tell the scheduler to give preference to other applications with a lower priority number or lower nice factor (at same priority).
If these servers are running in virtual machines, then often the virtual machine manager has tools to change the priority or nice factor for a particular VM. Most of the time, these operations can be done without restarting the server, or the virtual machine.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
if they think your VM is using too much CPU, then on the server side they should be posing a limit on you, rather than having you limit the CPU usage of a particular process