[sheepdog] [PATCH v1] try to set RLIMIT_NOFILE ro recommended value

Vasiliy Tolstov v.tolstov at selfip.ru
Mon Mar 16 22:38:12 CET 2015


2015-03-16 20:19 GMT+03:00 Alexander Guy <alexander at andern.org>:
> Hi Vasiliy,
>     Are you sure about that?  I'm pretty sure setrlimit(RLIMIT_NOFILE, ...)
> applies to the calling process, just like prlimit(0, RLIMIT_NOFILE, ...) would.


Ok, i'm re-read man page and fix my code =) Thanks.

>
>> 2015-03-16 19:30 GMT+03:00 Vasiliy Tolstov <v.tolstov at selfip.ru>:
>> > Signed-off-by: Vasiliy Tolstov <v.tolstov at selfip.ru>
>> > ---
>> >  sheep/sheep.c | 63 +++++++++++++++++++++++++++++++++++++++--------------------
>> >  1 file changed, 42 insertions(+), 21 deletions(-)
>> >
>> > diff --git a/sheep/sheep.c b/sheep/sheep.c
>> > index a1028a2..13cc927 100644
>> > --- a/sheep/sheep.c
>> > +++ b/sheep/sheep.c
>> > @@ -561,26 +561,47 @@ static int create_work_queues(void)
>> >
> [cut]
>> > +    len = asprintf(&buf, "%lu", new.rlim_max);
>> > +    if (len > 0) {
>> > +      fd = open("/proc/sys/fs/nr_open", O_WRONLY);
>
> The distribution and system administrator already have control over this by sysctl.
> I don't think sheepdog should be modifying the kernel's limits.  It's too much magic.


Yes, i think so.

-- 
Vasiliy Tolstov,
e-mail: v.tolstov at selfip.ru
jabber: vase at selfip.ru



More information about the sheepdog mailing list