spawning man page

spawning — manual page for spawning 0.9.7


spawning [options]


Spawning is an easy-to-use and flexible wsgi server. It supports graceful restarting so that your site finishes serving any old requests while starting new processes to handle new requests with the new code. For the simplest usage, simply pass the dotted path to your wsgi application: 'spawn my_module.my_wsgi_app'



show program's version number and exit

-h, --help

show this help message and exit

-v, --verbose

Display verbose configuration information when starting up or restarting.

-f FACTORY, --factory=FACTORY

Dotted path (eg mypackage.mymodule.myfunc) to a callable which takes a dictionary containing the command line arguments and figures out what needs to be done to start the wsgi application. Current valid values are: spawning.wsgi_factory.config_factory, spawning.paste_factory.config_factory, and spawning.django_factory.config_factory. The factory used determines what the required positional command line arguments will be. See the spawning.wsgi_factory module for documentation on how to write a new factory.

-i HOST, --host=HOST

The local ip address to bind.

-p PORT, --port=PORT

The local port address to bind.


The number of unix processes to start to use for handling web i/o.

-t THREADS, --threads=THREADS

The number of posix threads to use for handling web requests. If threads is 0, do not use threads but instead use eventlet's cooperative greenlet-based microthreads, monkeypatching the socket and pipe operations which normally block to cooperate instead. Note that most blocking database api modules will not automatically cooperate.

-d, --daemonize

Daemonize after starting children.

-u ID, --chuid=ID

Change user ID in daemon mode (and group ID if given, separate with colon.)


Write own process ID to FILE in daemon mode.


Redirect stdout to FILE in daemon mode.


Redirect stderr to FILE in daemon mode.

-w WATCH, --watch=WATCH

Watch the given file's modification time. If the file changes, the web server will restart gracefully, allowing old requests to complete in the old processes while starting new processes with the latest code or configuration.

-r RELOAD, --reload=RELOAD

If --reload=dev is passed, reload any time a loaded module or configuration file changes.

--deadman=DEADMAN_TIMEOUT, --deadman_timeout=DEADMAN_TIMEOUT

When killing an old i/o process because the code has changed, don't wait any longer than the deadman timeout value for the process to gracefully exit. If all requests have not completed by the deadman timeout, the process will be mercilessly killed.

-l ACCESS_LOG_FILE, --access-log-file=ACCESS_LOG_FILE

The file to log access log lines to. If not given, log to stdout. Pass /dev/null to discard logs.

-c, --coverage

If given, gather coverage data from the running program and make the coverage report available from the /_coverage url. See the figleaf docs for more info:


If given, gather system information data and make the report available from the /_sysinfo url.

-m MAX_MEMORY, --max-memory=MAX_MEMORY

If given, the maximum amount of memory this instance of Spawning is allowed to use. If all of the processes started by this Spawning controller use more than this amount of memory, send a SIGHUP to the controller to get the children to restart.


Start a backdoor bound to localhost:3000

-a MAX_AGE, --max-age=MAX_AGE

If given, the maximum amount of time (in seconds) an instance of spawning_child is allowed to run. Once this time limit has expired the child willgracefully kill itself while the server starts a replacement.


Disable HTTP/1.1 KeepAlive

-z RESTART_ARGS, --z-restart-args=RESTART_ARGS

For internal use only


If given, hosts a server status page at that port. Two pages are served: a human-readable HTML version at http://host:status_port/status, and a machine-readable version at http://host:status_port/status.json


If given, binds the server status page to the specified local ip address.  Defaults to the same value as --host.  If --status-port is not supplied, the status page will not be activated.

See Also

The full documentation for spawning is maintained as a Texinfo manual.  If the info and spawning programs are properly installed at your site, the command

info spawning

should give you access to the complete manual.


February 2017 spawning 0.9.7 User Commands