[Gllug] Forcing CPU and Mem limits on a process

Rich Walker rw at shadow.org.uk
Fri Feb 11 14:42:50 UTC 2005


Joel Bernstein <joel at fysh.org> writes:

> 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.
[snip]

> Limiting to 25% CPU isn't doable, I don't think, but do you really need
> to do this? UNIX works with process priorities, so you can use nice to
> set a very low priority on the process. Thus on an unloaded system it
> can take 100% CPU if it wants to, but other processes will have a
> higher priority and be able to override this.

You could set the task to a real-time priority, and then run three other
tasks at the same priority that busy-waited.

Probably not what you want, though. You probably just want to nice it to
a low priority.
[chop]

cheers, Rich.

-- 
rich walker         |  Shadow Robot Company | rw at shadow.org.uk
technical director     251 Liverpool Road   |
need a Hand?           London  N1 1LX       | +UK 20 7700 2487
www.shadow.org.uk/products/newhand.shtml
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list