Changeset 107:7d875cf20263
- Timestamp:
- 02/12/10 06:25:11
(6 months ago)
- Author:
- olt@bogosoft.com
- branch:
- default
- Message:
add minSpare, maxSpare, maxChildren and maxRequests options to paste server factories
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r94 |
r107 |
|
| 48 | 48 | def run_ajp_fork(wsgi_app, global_conf, |
|---|
| 49 | 49 | scriptName='', host='localhost', port='8009', |
|---|
| 50 | | allowedServers='127.0.0.1', debug=NoDefault): |
|---|
| | 50 | allowedServers='127.0.0.1', debug=NoDefault, |
|---|
| | 51 | minSpare=None, maxSpare=None, |
|---|
| | 52 | maxChildren=None, maxRequests=None): |
|---|
| 51 | 53 | import flup.server.ajp_fork |
|---|
| 52 | 54 | addr = (host, int(port)) |
|---|
| … | … | |
| 54 | 56 | debug = global_conf.get('debug', False) |
|---|
| 55 | 57 | debug = asbool(debug) |
|---|
| | 58 | prefork_args = {} |
|---|
| | 59 | if minSpare is not None: |
|---|
| | 60 | prefork_args['minSpare'] = int(minSpare) |
|---|
| | 61 | if maxSpare is not None: |
|---|
| | 62 | prefork_args['maxSpare'] = int(maxSpare) |
|---|
| | 63 | if maxChildren is not None: |
|---|
| | 64 | prefork_args['maxChildren'] = int(maxChildren) |
|---|
| | 65 | if maxRequests is not None: |
|---|
| | 66 | prefork_args['maxRequests'] = int(maxRequests) |
|---|
| 56 | 67 | s = flup.server.ajp_fork.WSGIServer( |
|---|
| 57 | 68 | wsgi_app, |
|---|
| … | … | |
| 59 | 70 | bindAddress=addr, |
|---|
| 60 | 71 | allowedServers=aslist(allowedServers), |
|---|
| 61 | | debug=debug, |
|---|
| | 72 | debug=debug, **prefork_args |
|---|
| 62 | 73 | ) |
|---|
| 63 | 74 | s.run() |
|---|
| … | … | |
| 92 | 103 | socket=None, umask=None, |
|---|
| 93 | 104 | multiplexed=False, |
|---|
| 94 | | debug=NoDefault): |
|---|
| | 105 | debug=NoDefault, |
|---|
| | 106 | minSpare=None, maxSpare=None, |
|---|
| | 107 | maxChildren=None, maxRequests=None): |
|---|
| 95 | 108 | import flup.server.fcgi_fork |
|---|
| 96 | 109 | if socket: |
|---|
| … | … | |
| 107 | 120 | debug = global_conf.get('debug', False) |
|---|
| 108 | 121 | debug = asbool(debug) |
|---|
| | 122 | prefork_args = {} |
|---|
| | 123 | if minSpare is not None: |
|---|
| | 124 | prefork_args['minSpare'] = int(minSpare) |
|---|
| | 125 | if maxSpare is not None: |
|---|
| | 126 | prefork_args['maxSpare'] = int(maxSpare) |
|---|
| | 127 | if maxChildren is not None: |
|---|
| | 128 | prefork_args['maxChildren'] = int(maxChildren) |
|---|
| | 129 | if maxRequests is not None: |
|---|
| | 130 | prefork_args['maxRequests'] = int(maxRequests) |
|---|
| 109 | 131 | s = flup.server.fcgi_fork.WSGIServer( |
|---|
| 110 | 132 | wsgi_app, |
|---|
| 111 | 133 | bindAddress=sock, umask=umask, |
|---|
| 112 | 134 | multiplexed=asbool(multiplexed), |
|---|
| 113 | | debug=debug) |
|---|
| | 135 | debug=debug, **prefork_args |
|---|
| | 136 | ) |
|---|
| 114 | 137 | s.run() |
|---|
| 115 | 138 | |
|---|
| … | … | |
| 135 | 158 | scriptName=NoDefault, host='localhost', port='4000', |
|---|
| 136 | 159 | allowedServers='127.0.0.1', |
|---|
| 137 | | debug=NoDefault): |
|---|
| | 160 | debug=NoDefault, |
|---|
| | 161 | minSpare=None, maxSpare=None, |
|---|
| | 162 | maxChildren=None, maxRequests=None): |
|---|
| 138 | 163 | import flup.server.scgi_fork |
|---|
| 139 | 164 | addr = (host, int(port)) |
|---|
| … | … | |
| 141 | 166 | debug = global_conf.get('debug', False) |
|---|
| 142 | 167 | debug = asbool(debug) |
|---|
| | 168 | prefork_args = {} |
|---|
| | 169 | if minSpare is not None: |
|---|
| | 170 | prefork_args['minSpare'] = int(minSpare) |
|---|
| | 171 | if maxSpare is not None: |
|---|
| | 172 | prefork_args['maxSpare'] = int(maxSpare) |
|---|
| | 173 | if maxChildren is not None: |
|---|
| | 174 | prefork_args['maxChildren'] = int(maxChildren) |
|---|
| | 175 | if maxRequests is not None: |
|---|
| | 176 | prefork_args['maxRequests'] = int(maxRequests) |
|---|
| 143 | 177 | s = flup.server.scgi_fork.WSGIServer( |
|---|
| 144 | 178 | wsgi_app, |
|---|
| … | … | |
| 146 | 180 | bindAddress=addr, |
|---|
| 147 | 181 | allowedServers=aslist(allowedServers), |
|---|
| 148 | | debug=debug, |
|---|
| | 182 | debug=debug, **prefork_args |
|---|
| 149 | 183 | ) |
|---|
| 150 | 184 | s.run() |
|---|