Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.system > #283

how to limit CPU usage for a process ands its child (or for a user)

From nicolas.antoniazzi@gmail.com
Newsgroups comp.os.linux.development.system
Subject how to limit CPU usage for a process ands its child (or for a user)
Date 2011-09-28 08:12 -0700
Organization http://groups.google.com
Message-ID <24023658.1657.1317222741913.JavaMail.geo-discussion-forums@yqmw31> (permalink)

Show all headers | View raw


Hello,

I would like to know if there is a way to limit CPU usage of a process and its child.
I used setrlimit with RLIMIT_CPU, but all child process inherit from the same value as the parent.

If I limit a process P0 to 2s, and P0 fork() 2 children (P1 and P2), P1 and P2 will have 2 new seconds of cpu time too.
I would like a global CPU time for all my process from P0 and not 2s for each.

A fork bomb can easily eat all CPU with this method. (I know that I can limit the number of process, but this is not the same usage).

Is there a way to control this ? Or is it possible to limit CPU per user instead of per process ?

Thanks.

Back to comp.os.linux.development.system | Previous | NextNext in thread | Find similar


Thread

how to limit CPU usage for a process ands its child (or for a user) nicolas.antoniazzi@gmail.com - 2011-09-28 08:12 -0700
  Re: how to limit CPU usage for a process ands its child (or for a user) John Reiser <jreiserfl@comcast.net> - 2011-09-28 09:08 -0700
  Re: how to limit CPU usage for a process ands its child (or for a user) "Ersek, Laszlo" <lacos@caesar.elte.hu> - 2011-09-28 23:33 +0200
    Re: how to limit CPU usage for a process ands its child (or for a user) nicolas.antoniazzi@gmail.com - 2011-09-28 16:44 -0700

csiph-web