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)

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
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 Wed, 28 Sep 2011 08:12:21 -0700 (PDT)
Organization http://groups.google.com
Lines 13
Message-ID <24023658.1657.1317222741913.JavaMail.geo-discussion-forums@yqmw31> (permalink)
Reply-To comp.os.linux.development.system@googlegroups.com
NNTP-Posting-Host 193.52.138.10
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1317223174 26265 127.0.0.1 (28 Sep 2011 15:19:34 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Wed, 28 Sep 2011 15:19:34 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=193.52.138.10; posting-account=DkPwvgoAAAB4htaH3hRcgT24Pp2N_Apj
User-Agent G2/1.0
X-Google-Web-Client true
Xref x330-a1.tempe.blueboxinc.net comp.os.linux.development.system:283

Show key headers only | 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