[Gllug] Forcing CPU and Mem limits on a process

David Abbishaw David at Abbishaw.com
Mon Feb 14 17:00:15 UTC 2005


The idea is really to be able to virtually partition a machine so that we
can guarantee a customer an amount of CPU time and RAM, thus if someone else
application starts hogging a CPU /RAM it doesn't affect other customers.  Ee
can do this in Windows 2003 (with wsrm) and with VMWare ESX server although
ESX has a huge overhead per VM (in disk, cpu, ram and support and licences)

Oh well sounds like a feature that's not quite there yet in Linux, I'm sure
one day it will emerge.  

Does this mean that UML suffers from one instance being able to use all
resources on a machine?





Message: 9
Date: Sun, 13 Feb 2005 21:05:13 +0000
From: John Hearns <john.hearns at streamline-computing.com>
Subject: Re: [Gllug] Forcing CPU and Mem limits on a process
To: Greater London Linux User Group <gllug at gllug.org.uk>
Message-ID: <1108328713.6019.33.camel at Vigor11>
Content-Type: text/plain

On Sun, 2005-02-13 at 16:51 +0000, Nix wrote:
> On Fri, 11 Feb 2005, John Edwards wrote:
> > On Fri, Feb 11, 2005 at 01:50:26PM -0000, David Abbishaw wrote:
> >> Can anyone recommend how I can run a process and define that it can
only
> >> use say 25% of the cpu and an amount of memory???  I thought nice would
do
> >> the CPU but it doesnt look great.
> > 
Your question makes me think of batch scheduling systems.

In a multiuser environment, you would think of using a resource
scheduling system like Gridengine  http://gridengine.sunsource.net
You can set hard and soft limits for memory in Gridengine.
These are set by 'setrlimit' - so are the same limits other people in
the thread have referred to.
At the soft limit, the job is sent a signal, so the user code CAN trap
this and do something sensible before halting.
At the hard limit the job is killed.


The '25% of CPU' is an intriguing one.
I don't think it is possible looking at it with Gridengine eyes -
after all a scheduler is supposed to keep your cluster humming along
at maximum utilisation!

However, queues in Gridengine can have subservient queues, so that
(for instance) short test jobs can get priority over long running jobs.
The subservient queue jobs are suspended.
In combination with that, you can write your own 'load sensors'.
I GUESS that you might hack some sort of load sensor script to suspend 
queues when CPU utilisation goes above 25%, but it would be against
nature :-)

Seriously though, if you are looking to limit TOTAL cpu usage,
rather than a percentage,  then Gridengine is the tool for you.



-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list