Re: [PATCH 2.6.13-rc6 1/2] New Syscall: get rlimits of any process (update)

Ulrich Drepper
2005-08-23T05:52:29Z

On 8/18/05, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> Perhaps those application authors should provide a management interface
> to do so within the soft limit range at least. Its not clear to me that
> growing the fd array on a process is even safe. Some programs do size
> arrays at startup after querying the rlimit data.

That's very true. Using such a remote-rlimit syscall would break all
kinds of code. It's a basic assumption from Unix/POSIX that the
limits remain constant. And as Alan hinted at: this is why there are
soft and hard limits. If tey are set to the same value you obviously
don't get anything. But this is the application programmer's fault.
An application which is aware of resources and tries to limit them
should set the soft limits to a reasonable low value and the hard
limit to the absolute maximum (probably the system's maximum). Then
you can have remote procedure calls into the application to adjust the
soft limits. Having to change the hard limit means the capacity
planning for the app is completely wrong. A restart is certainly
acceptable in that case since it should really never happen.