Commit a6f6c48f 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 nexedi/erp5@39369169 the new option
'nofile' was added to set the soft limit of open file descriptors to its hard limit.
In nexedi/slapos!1451 (comment 193296) it was criticized that
the name of the option - 'nofile' - is too vague and in nexedi/slapos!1465 a new
name for the option was searched. Finally we agreed on the more explicit 'with-max-rlimit-nofile'.
parent b2e8e825
...@@ -166,7 +166,7 @@ def runwsgi(): ...@@ -166,7 +166,7 @@ def runwsgi():
parser.add_argument('zope_conf', help='path to zope.conf') parser.add_argument('zope_conf', help='path to zope.conf')
parser.add_argument('--timerserver-interval', help='Interval for timerserver', type=float) parser.add_argument('--timerserver-interval', help='Interval for timerserver', type=float)
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()
...@@ -191,7 +191,7 @@ def runwsgi(): ...@@ -191,7 +191,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