From b59925329121138364b76241e87b3b8c566ecc52 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 6 Dec 2018 21:27:26 +0000 Subject: [PATCH] issue #435: increase file descriptor limit by 8x. This is a temporary solution at best. --- ansible_mitogen/target.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible_mitogen/target.py b/ansible_mitogen/target.py index 83069422..3b5c3a5f 100644 --- a/ansible_mitogen/target.py +++ b/ansible_mitogen/target.py @@ -96,9 +96,9 @@ good_temp_dir = None # default, resulting in huge (>500ms) runtime waste running many commands. # Therefore if we are a child, cap the range to something reasonable. rlimit = resource.getrlimit(resource.RLIMIT_NOFILE) -if (rlimit[0] > 512 or rlimit[1] > 512) and not mitogen.is_master: - resource.setrlimit(resource.RLIMIT_NOFILE, (512, 512)) - subprocess.MAXFD = 512 # Python <3.x +if (rlimit[0] > 4096 or rlimit[1] > 4096) and not mitogen.is_master: + resource.setrlimit(resource.RLIMIT_NOFILE, (4096, 4096)) + subprocess.MAXFD = 4096 # Python <3.x del rlimit