in options.py 1392:1414
ServerOptions.set_rlimits
for limit in limits:
min = limit['min']
res = limit['resource']
msg = limit['msg']
name = limit['name']
name = name # name is used below by locals()
soft, hard = resource.getrlimit(res)
if (soft < min) and (soft != -1): # -1 means unlimited
if (hard < min) and (hard != -1):
# setrlimit should increase the hard limit if we are
# root, if not then setrlimit raises and we print usage
hard = min
try:
resource.setrlimit(res, (min, hard))
msgs.append('Increased %(name)s limit to %(min)s' %
locals())
except (resource.error, ValueError):
self.usage(msg % locals())
return msgs
line 1402: if (soft < min) and (soft != -1): should not be present.
minfds is used to cleanup opened fd in Subprocess._prepare_child_fds. if system soft RLIMIT_NOFILE is greater than minds, some fd will not be closed properly, so minfds should always be set as the soft RLIMIT_NOFILE of the supervisors process.