supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Suggest documentation of "soft limit" logic for chpst
@ 2005-11-21 20:46 Jared Rhine
  2005-11-22  4:54 ` Laurent Bercot
  0 siblings, 1 reply; 5+ messages in thread
From: Jared Rhine @ 2005-11-21 20:46 UTC (permalink / raw)


It might be helpful to have a little bit of discussion on the chpst
manpage which outlines that chpst is dealing with soft limits.

I had been trying to raise the limit on number of open files via 'chpst
-o 10000'.  I thought this was working properly, so I was focused on
examining the daemon for bugs.  Then I finally had the insight to test
whether 'chpst -o 10000 && ulimit -a' was doing what I expect.  Now I'm
doing a 'ulimit -n 10000' instead of a 'chpst -o 10000'.

I had read the manpage a couple of times while doing this investigation,
but it's brief with respect to what chpst is really doing with these
switches.  It wasn't until I saw "softlimit(8)" at the bottom that I
started to suspect the source of my problem.  Maybe mentioning the
actual logic in-line with the manpage text would be useful.

I'd also be in favor of chpst being able to raise limits (hard ulimit)
to emulate ulimit more directly, but that's a separate conversation.


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: suggest documentation of "soft limit" logic for chpst
@ 2012-09-21  7:04 Gildas
  0 siblings, 0 replies; 5+ messages in thread
From: Gildas @ 2012-09-21  7:04 UTC (permalink / raw)
  To: supervision

[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]

Hi,

I know it's weird to quote a subject from 2005, but I found this while I
was looking for a reason why chpst wasn't behaving the way it was expected
(when one assume you can raise the limit above the hard value).

It seems that chpst is very often used to raise the number of file limit
when starting a daemon as root, as the default file number limit in Linux
(1024) is not enough for a number of use cases.

To be able to do that, though, one as to do "ulimit -n 5000; chpst -o 5000
command", which seems to be like a waste of resources since the same
syscalls are called again and again.

It would be nice if you could raise the hard limit above its  previously
set value in a simpler way that would make it more efficient for the use
case above.

I've tested a naive patch (https:// <https://gist.github.com/3757463>
gist.github.com
<https://gist.github.com/3757463>/3757463<https://gist.github.com/3757463>)
that allows to set a higher value for both soft and hard values when the
given limit is over the hard value AND the effective uid is 0.

This would fix the use case above as your could run a command as root with
a higher file limit value than the default with a more concise "chpst -o
5000 command".

Does it makes sense? What have I overlooked? Thanks for your insights on
the matter!

If  it actually makes sense, and this modification could be merged, I'd be
glad to provide a patched version of the manpage as well!

Regards, Gildas

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-21  7:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-21 20:46 Suggest documentation of "soft limit" logic for chpst Jared Rhine
2005-11-22  4:54 ` Laurent Bercot
2005-11-23  5:47   ` Jared Rhine
2005-11-23 13:35     ` Laurent Bercot
2012-09-21  7:04 suggest " Gildas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).