Fixed $2973: added minspare/maxspare/maxchildren options to runfcgi. Thanks, James Crasta.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4033 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2006-11-07 02:01:16 +00:00
parent 726756bdd5
commit 0fd9f6ec6b
1 changed files with 8 additions and 4 deletions

View File

@ -33,9 +33,9 @@ Optional Fcgi settings: (setting=value)
method=IMPL prefork or threaded (default prefork) method=IMPL prefork or threaded (default prefork)
maxrequests=NUMBER number of requests a child handles before it is maxrequests=NUMBER number of requests a child handles before it is
killed and a new child is forked (0 = no limit). killed and a new child is forked (0 = no limit).
maxspare=NUMBER max number of spare processes to keep running. maxspare=NUMBER max number of spare processes / threads
minspare=NUMBER min number of spare processes to prefork. minspare=NUMBER min number of spare processes / threads.
maxchildren=NUMBER hard limit number of processes in prefork mode. maxchildren=NUMBER hard limit number of processes / threads
daemonize=BOOL whether to detach from terminal. daemonize=BOOL whether to detach from terminal.
pidfile=FILE write the spawned process-id to this file. pidfile=FILE write the spawned process-id to this file.
workdir=DIRECTORY change to this directory when daemonizing workdir=DIRECTORY change to this directory when daemonizing
@ -110,7 +110,11 @@ def runfastcgi(argset=[], **kwargs):
} }
elif options['method'] in ('thread', 'threaded'): elif options['method'] in ('thread', 'threaded'):
from flup.server.fcgi import WSGIServer from flup.server.fcgi import WSGIServer
wsgi_opts = {} wsgi_opts = {
'maxSpare': int(options["maxspare"]),
'minSpare': int(options["minspare"]),
'maxThreads': int(options["maxchildren"]),
}
else: else:
return fastcgi_help("ERROR: Implementation must be one of prefork or thread.") return fastcgi_help("ERROR: Implementation must be one of prefork or thread.")