2003-11-02 09:05:18

by Ville Herva

[permalink] [raw]
Subject: getrlimit for an arbitrary process?

[I did try google, but wasn't lucky, so...]

Is there a way to query/set getrlimit/setrlimit for an arbitrary process?
Not that I absolutely need it, but it would be nice to know if a daemon
really has resource limits in effect.

Couldn't find it under /proc, at least on 2.4.x.

(A 2.4.21-pre4aa3 server just locked up hard rather horrendeously when
SpamAssassin spamd decided to fork a couple of thousand processes... Looks
like I need sprinkle ulimit lines all over /etc/init.d/*.)


-- v --

[email protected]


2003-11-03 03:14:17

by Rik van Riel

[permalink] [raw]
Subject: Re: getrlimit for an arbitrary process?

On Sun, 2 Nov 2003, Ville Herva wrote:

> Is there a way to query/set getrlimit/setrlimit for an arbitrary process?

Nope, rlimits only work on the current process
(and a few of them work on the current UID).

> Couldn't find it under /proc, at least on 2.4.x.

Good idea for 2.7, though we might as well go
all the way and set up more arbitrary resource
groups.

Take a look at http://ckrm.sourceforge.net/ ;)

--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

2003-11-03 06:22:10

by Ville Herva

[permalink] [raw]
Subject: Re: getrlimit for an arbitrary process?

On Sun, Nov 02, 2003 at 10:14:11PM -0500, you [Rik van Riel] wrote:
>
> Nope, rlimits only work on the current process
> (and a few of them work on the current UID).

Yep.

> > Couldn't find it under /proc, at least on 2.4.x.
>
> Good idea for 2.7, though we might as well go
> all the way and set up more arbitrary resource
> groups.
>
> Take a look at http://ckrm.sourceforge.net/ ;)

Interesting. So is linux-vservers (and a bunch of other projects). I hope
the common denominator of these can be distilled out and soaked into the
mainline kernel...


thanks,

-- v --

[email protected]