2002-11-27 10:03:20

by Frederik Dannemare

[permalink] [raw]
Subject: Limiting max cpu usage per user (old Conectiva patch)

Hi all,

do we have an effective way to limit max cpu usage per user? I haven't been
able to find much useful info except for an old thread on lkml, where Rik
van Riel mentions[1] a 2.2 kernel patch by Conectiva.

Anybody knows if this patch (or similar functionality) been ported to 2.4
(or 2.5)?

[1]http://www.uwsg.iu.edu/hypermail/linux/kernel/0108.2/0362.html

--
Frederik



2002-11-27 12:01:51

by Rik van Riel

[permalink] [raw]
Subject: Re: Limiting max cpu usage per user (old Conectiva patch)

On Wed, 27 Nov 2002, Frederik Dannemare wrote:

> do we have an effective way to limit max cpu usage per user? I haven't been
> able to find much useful info except for an old thread on lkml, where Rik
> van Riel mentions[1] a 2.2 kernel patch by Conectiva.
>
> Anybody knows if this patch (or similar functionality) been ported to 2.4
> (or 2.5)?

It's on my patches page:

http://surriel.com/patches/

cheers,

Rik
--
Bravely reimplemented by the knights who say "NIH".
http://www.surriel.com/ http://guru.conectiva.com/
Current spamtrap: <a href=mailto:"[email protected]">[email protected]</a>

2002-11-27 13:47:22

by Hu Gang

[permalink] [raw]
Subject: Re: Limiting max cpu usage per user (old Conectiva patch)

On Wed, 27 Nov 2002 10:08:56 -0200 (BRST)
Rik van Riel <[email protected]> wrote:

> It's on my patches page:
>
> http://surriel.com/patches/
>
> cheers,
The patch is works. Here is the test.
w.c
-------
#include <stdio.h>
main()
{
while(1);
}

-------
start 5 w as normal user..
start 5 w as root user.

Enabel the fairsched
echo 1 > /proc/sys/kernel/fairsched
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
976 root 20 0 248 248 204 R 13.1 0.0 0:28 w
974 root 20 0 248 248 204 R 12.9 0.0 0:28 w
975 root 20 0 248 248 204 R 12.9 0.0 0:28 w
973 root 17 0 248 248 204 R 12.5 0.0 0:29 w
972 root 14 0 248 248 204 R 11.9 0.0 0:30 w
968 hugang 20 0 252 252 208 R 7.1 0.0 0:18 w
970 hugang 20 0 252 252 208 R 7.1 0.0 0:17 w
967 hugang 20 0 252 252 208 R 5.9 0.0 0:19 w
969 hugang 20 0 252 252 208 R 5.9 0.0 0:17 w
966 hugang 14 0 252 252 208 R 5.9 0.0 0:20 w

Disabel the fairsched
echo 0 > /proc/sys/kernel/fairsched
969 hugang 16 0 252 252 208 R 9.7 0.0 0:20 w
970 hugang 16 0 252 252 208 R 9.7 0.0 0:19 w
966 hugang 16 0 252 252 208 R 9.5 0.0 0:23 w
974 root 16 0 248 248 204 R 9.5 0.0 0:32 w
968 hugang 16 0 252 252 208 R 9.5 0.0 0:20 w
975 root 16 0 248 248 204 R 9.5 0.0 0:32 w
976 root 16 0 248 248 204 R 9.5 0.0 0:32 w
972 root 16 0 248 248 204 R 9.5 0.0 0:34 w
967 hugang 16 0 252 252 208 R 9.1 0.0 0:21 w
973 root 16 0 248 248 204 R 8.9 0.0 0:33 w

--
- Hu Gang

2002-11-27 15:10:50

by Frederik Dannemare

[permalink] [raw]
Subject: Re: Limiting max cpu usage per user (old Conectiva patch)

Rik van Riel wrote:
> On Wed, 27 Nov 2002, Frederik Dannemare wrote:
>
>>do we have an effective way to limit max cpu usage per user? I haven't been
>>able to find much useful info except for an old thread on lkml, where Rik
>>van Riel mentions[1] a 2.2 kernel patch by Conectiva.
>>
>>Anybody knows if this patch (or similar functionality) been ported to 2.4
>>(or 2.5)?
>
> It's on my patches page:
>
> http://surriel.com/patches/
>

Great. Many thanks. I'll go test it right away.

--
Frederik

2002-11-27 20:02:07

by Martin Waitz

[permalink] [raw]
Subject: Re: Limiting max cpu usage per user (old Conectiva patch)

hi :)

On Wed, Nov 27, 2002 at 11:11:50AM +0100, Frederik Dannemare wrote:
> do we have an effective way to limit max cpu usage per user?

i'm working on a resource container implementation for linux
for my diploma thesis.

resource container provide a hierarchical way to account and
limit resources.
this way not only per user limits can be achieved, but any
policy you can think of (per service, per client, ...)

the work is due january, but interested people could have
a look at the (undocumented for now ;) source earlier.

--
CU, / Friedrich-Alexander University Erlangen, Germany
Martin Waitz // [Tali on IRCnet] [tali.home.pages.de] _________
______________/// - - - - - - - - - - - - - - - - - - - - ///
dies ist eine manuell generierte mail, sie beinhaltet //
tippfehler und ist auch ohne grossbuchstaben gueltig. /
-
Wer bereit ist, grundlegende Freiheiten aufzugeben, um sich
kurzfristige Sicherheit zu verschaffen, der hat weder Freiheit
noch Sicherheit verdient.
Benjamin Franklin (1706 - 1790)


Attachments:
(No filename) (1.01 kB)
(No filename) (189.00 B)
Download all attachments

2002-11-27 23:04:30

by Marc-Christian Petersen

[permalink] [raw]
Subject: Re: Limiting max cpu usage per user (old Conectiva patch)

Hi Frederik,

I can offer you a really nice small patch from Karol Golab. Find it here:

- http://www.tls-technologies.com/CPU/cpu-intro.html

works great for me.

ciao, Marc

2002-11-28 12:23:31

by Frederik Dannemare

[permalink] [raw]
Subject: Re: Limiting max cpu usage per user (old Conectiva patch)

Marc-Christian Petersen skrev:
> Hi Frederik,
>
> I can offer you a really nice small patch from Karol Golab. Find it here:
>
> - http://www.tls-technologies.com/CPU/cpu-intro.html
>
> works great for me.

Thanks a lot. I'll check it out for sure.

--
Frederik