Commit c42c1d38 authored by Levin Zimmermann's avatar Levin Zimmermann

fixup! ERP5/zopewsgi: Add option to set soft limit of open file descriptors to hard limit

In 39369169 the new option
'nofile' was added to set the soft limit of open file descriptors to its hard limit.
In slapos!1451 (comment 193296) it was criticized that
the name of the option - 'nofile' - is too vague and in slapos!1465 a new
name for the option was searched. Finally we agreed on the more explicit 'with-max-rlimit-nofile'.
parent 4351a193
...@@ -186,7 +186,7 @@ def runwsgi(): ...@@ -186,7 +186,7 @@ def runwsgi():
type=type_registry.get('byte-size'), type=type_registry.get('byte-size'),
default=type_registry.get('byte-size')("10MB")) default=type_registry.get('byte-size')("10MB"))
parser.add_argument( parser.add_argument(
'--nofile', '--with-max-rlimit-nofile',
help='Set soft limit of file descriptors erp5 can open to hard limit', help='Set soft limit of file descriptors erp5 can open to hard limit',
action="store_true") action="store_true")
args = parser.parse_args() args = parser.parse_args()
...@@ -263,7 +263,7 @@ def runwsgi(): ...@@ -263,7 +263,7 @@ def runwsgi():
interval=args.timerserver_interval, interval=args.timerserver_interval,
) )
if args.nofile: if args.with_max_rlimit_nofile:
cur_limit = resource.getrlimit(resource.RLIMIT_NOFILE) cur_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
new_limit = (cur_limit[1], cur_limit[1]) new_limit = (cur_limit[1], cur_limit[1])
resource.setrlimit(resource.RLIMIT_NOFILE, new_limit) resource.setrlimit(resource.RLIMIT_NOFILE, new_limit)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment