From 8d7a055b082a84eb01ab150fb29a375cf0ef091c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Tue, 6 Jul 2021 17:25:25 +0200 Subject: [PATCH] Set an upper limit on concurrent FDs I don't have the time nor will to look into it properly. --- ponymap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ponymap.c b/ponymap.c index f8c0ac4..1c93f88 100644 --- a/ponymap.c +++ b/ponymap.c @@ -2014,6 +2014,10 @@ main (int argc, char *argv[]) else { limit.rlim_cur = limit.rlim_max; + + // But too much may be seriously detrimental to function + limit.rlim_cur = MIN (limit.rlim_cur, 1 << 16); + if (setrlimit (RLIMIT_NOFILE, &limit)) print_warning ("%s: %s", "setrlimit failed", strerror (errno)); }