Ticket #2973: fastcgi-threadpool-options.diff

File fastcgi-threadpool-options.diff, 1.4 KB (added by James Crasta <jcrasta@…>, 18 years ago)

Allow runfcgi to pass threadpool options to flup

  • django/core/servers/fastcgi.py

     
    3333  method=IMPL          prefork or threaded (default prefork)
    3434  maxrequests=NUMBER   number of requests a child handles before it is
    3535                       killed and a new child is forked (0 = no limit).
    36   maxspare=NUMBER      max number of spare processes to keep running.
    37   minspare=NUMBER      min number of spare processes to prefork.
    38   maxchildren=NUMBER   hard limit number of processes in prefork mode.
     36  maxspare=NUMBER      max number of spare processes / threads
     37  minspare=NUMBER      min number of spare processes / threads.
     38  maxchildren=NUMBER   hard limit number of processes / threads
    3939  daemonize=BOOL       whether to detach from terminal.
    4040  pidfile=FILE         write the spawned process-id to this file.
    4141  workdir=DIRECTORY    change to this directory when daemonizing
     
    110110        }
    111111    elif options['method'] in ('thread', 'threaded'):
    112112        from flup.server.fcgi import WSGIServer
    113         wsgi_opts = {}
     113        wsgi_opts = {
     114            'maxSpare': int(options["maxspare"]),
     115            'minSpare': int(options["minspare"]),
     116            'maxThreads': int(options["maxchildren"]),
     117        }
    114118    else:
    115119        return fastcgi_help("ERROR: Implementation must be one of prefork or thread.")
    116120
Back to Top