[Ctl] add options to limit number of child process and number of request per process

- new option --max-children allows to define the maximum number of
   child process handling request (default is 5).
 - new option --max-request allows to define the maximum number of
   requests per child before they exit (default is infinite).
This commit is contained in:
Benjamin Dauvergne 2010-07-29 11:25:11 +00:00
parent e284dcd35c
commit 20b82abc59
1 changed files with 12 additions and 0 deletions

View File

@ -44,6 +44,18 @@ def start(args):
i += 1
elif args[i] == '--spawn-cron':
run_kwargs['spawn_cron'] = True
elif args[i] == '--max-children':
try:
run_kwargs['max_children'] = int(args[i+1])
except:
raise SystemExit('--max-children needs an integer parameter')
i += 1
elif args[i] == '--max-requests':
try:
run_kwargs['handler_connection_limit'] = int(args[i+1])
except:
raise SystemExit('--max-requests needs an integer parameter')
i += 1
try: