Results 1 to 3 of 3
I have a VPS with centos and it runs this java program. (A minecraft server.)
It turned out that we were apparently using too much CPU and it was lagging ...
- 12-21-2010 #1Just Joined!
- Join Date
- Dec 2010
- Posts
- 1
Limit a processes CPU
I have a VPS with centos and it runs this java program. (A minecraft server.)
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.
Thanks
- 12-21-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,954
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!
- 12-21-2010 #3
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


Reply With Quote
