From: Ian Jackson <iwj@xenproject.org>
To: Juergen Gross <jgross@suse.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>
Subject: Re: [PATCH v5 2/2] tools/xenstore: set open file descriptor limit for xenstored
Date: Tue, 28 Sep 2021 16:26:36 +0100 [thread overview]
Message-ID: <24915.13356.139165.259646@mariner.uk.xensource.com> (raw)
In-Reply-To: <0bd81ff3-a7ac-4000-4c0c-d7127b1c1985@suse.com>
Juergen Gross writes ("Re: [PATCH v5 2/2] tools/xenstore: set open file descriptor limit for xenstored"):
> Hmm, maybe I should just use:
>
> prlimit --nofile=$XENSTORED_MAX_OPEN_FDS \
> $XENSTORED --pid-file @XEN_RUN_DIR@/xenstored.pid $XENSTORED_ARGS
I guess that would probably work (although it involves another
exec) but I don't understand what's wrong with ulimit, which is a
shell builtin.
I think this script has to run only on Linux and all reasonable Linux
/bin/sh have `ulimit`. (I have checked dash and bash.)
So I think just
ulimit -n $XENSTORED_MAX_OPEN_FDS
$XENSTORED --pid-file @XEN_RUN_DIR@/xenstored.pid $XENSTORED_ARGS
will DTRT. You could also do this
ulimit -n $XENSTORED_MAX_OPEN_FDS || true
which will arrange that if, somehow, this fails, the system is likely
to continue to mostly-work despite the error. Whether that would be
desirable is a matter of taste I think.
(I have RTFM again, and setting -H and -S separately is not needed;
omitting -H or -S means to set both.)
Ian.
next prev parent reply other threads:[~2021-09-28 15:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 9:15 [PATCH v5 0/2] tools/xenstore: set resource limits of xenstored Juergen Gross
2021-09-28 9:15 ` [PATCH v5 1/2] tools/xenstore: set oom score for xenstore daemon on Linux Juergen Gross
2021-09-28 9:15 ` [PATCH v5 2/2] tools/xenstore: set open file descriptor limit for xenstored Juergen Gross
2021-09-28 12:02 ` Ian Jackson
2021-09-28 12:15 ` Juergen Gross
2021-09-28 15:26 ` Ian Jackson [this message]
2021-09-29 5:31 ` Juergen Gross
2021-10-11 9:31 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=24915.13356.139165.259646@mariner.uk.xensource.com \
--to=iwj@xenproject.org \
--cc=jgross@suse.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.