From 676cf5c4f88309cf1b0efce793d308b9f40a400b Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Fri, 23 Apr 2010 10:11:02 -0400 Subject: [PATCH] Fix usage docs. --- doc/htdocs/configuration.html | 36 +++++++++-------------------------- doc/htdocs/news.html | 27 ++++++++++++++++---------- doc/htdocs/usage.html | 12 ++++++------ doc/site/usage.rst | 10 +++++----- 4 files changed, 37 insertions(+), 48 deletions(-) diff --git a/doc/htdocs/configuration.html b/doc/htdocs/configuration.html index 8289f38e..90ca6209 100644 --- a/doc/htdocs/configuration.html +++ b/doc/htdocs/configuration.html @@ -52,27 +52,7 @@

Gunicorn 0.5 introduced the ability to use a Python configuration file. Gunicorn will look for gunicorn.conf.py in the current working directory or what ever path is specified on the command line with the -c option.

Example gunicorn.conf.py

-

arbiter="egg:gunicorn", -backlog=2048, -bind='127.0.0.1:8000', -daemon=False, -debug=False, -default_proc_name = os.getcwd(), -group=None, -keepalive=2, -logfile='-', -loglevel='info', -pidfile=None, -proc_name = None, -spew=False, -timeout=30, -tmp_upload_dir=None, -umask="0", -user=None, -workers=1, -worker_connections=1000,

-arbiter = "egg:gunicorn"    # The arbiter to use for worker management
 backlog = 2048              # The listen queue size for the server socket
 bind = "127.0.0.1:8000"     # Or "unix:/tmp/gunicorn.sock"
 daemon = False              # Whether work in the background
@@ -89,6 +69,7 @@ proc_name = None            # Change the process name
 spew=False                  # Display trace
 timeout=30                  # Worker timeout
 tmp_upload_dir = None       # Set path used to store temporary uploads
+worker_class = "egg:gunicorn#sync"    # The type of request processing to use
 worker_connections=1000     # Maximum number of simultaneous connections
 
 after_fork=lambda server, worker: server.log.info(
@@ -104,16 +85,15 @@ before_exec=lambda server: server.log.info("Forked child, reexecuting"
 
after_fork(server, worker):
This is called by the worker after initialization.
-
arbiter:
-

The arbiter manages the worker processes that actually serve clients. It -handles launching new workers and killing misbehaving workers among -other things. By default the arbiter is egg:gunicorn#main. This arbiter +

worker_class:
+

Define the type of worker to use. A worker process all the requests send by +the arbiter.By default the worker_class is egg:gunicorn#sync. This worker only supports fast request handling requiring a buffering HTTP proxy.

If your application requires the ability to handle prolonged requests to provide long polling, comet, or calling an external web service you'll -need to use an async arbiter. Gunicorn has two async arbiters built in -using Eventlet or Gevent. You can also use the Evenlet arbiter with -the Twisted helper.

+need to use an async worker. Gunicorn has three async workers built in +using Tornado, Eventlet or Gevent. You can also use the Evenlet +worker with the Twisted helper.

backlog:
The backlog parameter defines the maximum length for the queue of pending @@ -156,6 +136,8 @@ installed. This alters the process names listed by commands like

News

+

0.8.0 / 2004-04-22

+
    +
  • Refactored Worker management for better async support. Now use the -k option to set the type of request processing to use
  • +
  • Added support for Tornado .
  • +
+
+

0.7.2 / 2010-04-15

  • Added --spew option to help debugging (install a Trace hook)
  • @@ -57,13 +64,13 @@
  • Fix a bug in start_response on error
-
+

0.7.1 / 2010-04-01

  • Fix bug when responses have no body.
-
+

0.7.0 / 2010-03-26

-
+

0.6.5 / 2010-03-11

  • Fix pidfile
  • Fix Exception Error
-
+

0.6.4 / 2010-03-08

  • Use cStringIO for performance when possible.
  • Fix worker freeze when a remote connection closes unexpectedly.
-
+

0.6.3 / 2010-03-07

  • Make HTTP parsing faster.
  • Some fixes (see logs)
-
+

0.6.2 / 2010-03-01

  • Added support for chunked response.
  • @@ -104,7 +111,7 @@
  • Workers are now murdered by age (the oldest is killed first).
-
+

0.6.1 / 2010-02-24

  • Added gunicorn config file support for django admin command
  • @@ -112,21 +119,21 @@
  • Removed TTIN/TTOU from workers which blocked other signals.
-
+

0.6 / 2010-02-22

  • Added setproctitle
  • Change privilege switch behaviour. We now work like NGINX, master keeps the permissions, new uid/gid permissions are only set for workers.
-
+

0.5.1 / 2010-02-22

  • Fix umask
  • Added debian packaging
-
+

0.5 / 2010-02-20

  • Added configuration file handler.
  • diff --git a/doc/htdocs/usage.html b/doc/htdocs/usage.html index c72fc008..3541fd08 100644 --- a/doc/htdocs/usage.html +++ b/doc/htdocs/usage.html @@ -59,19 +59,19 @@

    To launch the example application packaged with Gunicorn:

     $ cd /path/to/gunicorn/examples/
    -$ gunicorn --workers=2 test:app
    +$ gunicorn -w 2 test:app
     

    The module test:app specifies the complete module name and WSGI callable. You can replace it with anything that is available on your PYTHONPATH like such:

     $ cd ~/
    -$ gunicorn --workers=12 awesomeproject.wsgi.main:main_app
    +$ gunicorn -w 12 awesomeproject.wsgi.main:main_app
     

    To launch the websocket example application using Eventlet:

     $ cd /path/to/gunicorn/examples/
    -$ gunicorn -w 12 -a "egg:gunicorn#eventlet" websocket:app
    +$ gunicorn -w 12 -k "egg:gunicorn#eventlet" websocket:app
     

    You should then be able to visit http://localhost:8000 to see output.

    @@ -85,11 +85,11 @@ Options: Config file. [none] -b BIND, --bind=BIND Adress to listen on. Ex. 127.0.0.1:8000 or unix:/tmp/gunicorn.sock + -k WORKERCLASS, --worker-class=WORKERCLASS + The type of request processing to use + [egg:gunicorn#sync] -w WORKERS, --workers=WORKERS Number of workers to spawn. [1] - -a ARBITER, --arbiter=ARBITER - gunicorn arbiter entry point or module - [egg:gunicorn#main] -p PIDFILE, --pid=PIDFILE set the background PID FILE -D, --daemon Run daemonized in the background. diff --git a/doc/site/usage.rst b/doc/site/usage.rst index 872985e6..2594a4fb 100644 --- a/doc/site/usage.rst +++ b/doc/site/usage.rst @@ -14,19 +14,19 @@ WSGI applications To launch the `example application`_ packaged with Gunicorn:: $ cd /path/to/gunicorn/examples/ - $ gunicorn --workers=2 test:app + $ gunicorn -w 2 test:app The module ``test:app`` specifies the complete module name and WSGI callable. You can replace it with anything that is available on your ``PYTHONPATH`` like such:: $ cd ~/ - $ gunicorn --workers=12 awesomeproject.wsgi.main:main_app + $ gunicorn -w 12 awesomeproject.wsgi.main:main_app To launch the `websocket example`_ application using `Eventlet`_:: $ cd /path/to/gunicorn/examples/ - $ gunicorn -w 12 -a "egg:gunicorn#eventlet" websocket:app + $ gunicorn -w 12 -k "egg:gunicorn#eventlet" websocket:app You should then be able to visit ``http://localhost:8000`` to see output. @@ -44,8 +44,8 @@ Full command line usage -b BIND, --bind=BIND Adress to listen on. Ex. 127.0.0.1:8000 or unix:/tmp/gunicorn.sock -k WORKERCLASS, --worker-class=WORKERCLASS - The type of request processing to use - [egg:gunicorn#sync] + The type of request processing to use + [egg:gunicorn#sync] -w WORKERS, --workers=WORKERS Number of workers to spawn. [1] -p PIDFILE, --pid=PIDFILE