Find the answer to your Linux question:
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just 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

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    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!

  3. #3
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    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

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •