diff --git a/doc/htdocs/configuration.html b/doc/htdocs/configuration.html index b29d8740..53608f7d 100644 --- a/doc/htdocs/configuration.html +++ b/doc/htdocs/configuration.html @@ -53,9 +53,12 @@

Example gunicorn.conf.py

+arbiter="egg:gunicorn"  # Or "egg:gunicorn#eventlet" (eventlet or gevent)
+backlog = 2048
 bind = "127.0.0.1:8000" # Or "unix:/tmp/gunicorn.sock"
 daemon = False          # Whether work in the background
 debug = False           # Some extra logging
+keepalive = 2           # Time we wait for next connection (in ms)
 logfile = "-"           # Name of the log file
 loglevel = "info"       # The level at which to log
 pidfile = None          # Path to a PID file
@@ -65,6 +68,7 @@ user = None             # Change process owner to user
 group = None            # Change process group to group
 proc_name = None        # Change the process name
 tmp_upload_dir = None   # Set path used to store temporary uploads
+worker_connections=1000 # Number of connections accepted by a worker
 
 after_fork=lambda server, worker: server.log.info(
         "Worker spawned (pid: %s)" % worker.pid),
@@ -79,6 +83,10 @@ 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 you want to use. An arbiter maintain the workers processes alive. It launches or kills them if needed. It also manages application reloading via SIGHUP/USR2. By default it's egg:gunicorn#main. This arbiter only support fast clients connections. If you need to create a sleepy application or handling keepalive set it to egg:gunicorn#eventlet to use it with Eventlet or egg:gunicorn#gevent with Gevent. Eventlet arbiter can also be used with Twisted by using Eventlet helper.
+
backlog:
+
The backlog parameter defines the maximum length for the queue of pending connections see listen(2) for more information. The default is 2048.
before_fork(server, worker):
This is called by the worker just before forking.
before_exec(server):
@@ -91,6 +99,8 @@ before_exec=lambda server: server.log.info("Forked child, reexecuting"
If True, only one worker will be launch and the variable wsgi.multiprocess will be set to False.
group:
The group in which worker processes will be launched.
+
keepalive:
+
Keepalive timeout. The default is 2 seconds, which should be enough under most conditions for browsers to render the page and start retrieving extra elements for. Increasing this beyond 5 seconds is not recommended. Zero disables keepalive entirely.
logfile:
The path to the log file - (stdout) by default.
loglevel:
@@ -103,6 +113,8 @@ before_exec=lambda server: server.log.info("Forked child, reexecuting"
Used to set the umask when daemonizing.
user:
The user as which worker processes will by launched.
+
worker_connections:
+
Number of connections a worker can handle when used with Eventlet or Gevent arbiter. The default is 1000.
tmp_upload_dir:
Set the path used to store temporarily the body of the request.
diff --git a/doc/htdocs/faq.html b/doc/htdocs/faq.html index 568ce8b6..dccc9b27 100644 --- a/doc/htdocs/faq.html +++ b/doc/htdocs/faq.html @@ -60,11 +60,8 @@ the slowlori local network or from the same machine. This generally would refer to requests forwarded from an upstream proxy. Also see the above FAQ for what a fast client is not. -
Why only fast clients?
-
By designing a web server to only handle fast clients we can greatly simplify -the implementation. Think of it as a separation of concerns where your proxy -handles talking to the big bad world of the internet and filters the requests -to your application code.
+
What are sleepy applications?
+
Applications that expect long request/response times and/or slow clients. Gunicorn use Eventlet or Gevent to manage concurrency.
How might I test a proxy configuration?
Check out slowloris for a script that will generate significant slow traffic. If your application remains responsive through out that test you diff --git a/doc/htdocs/index.html b/doc/htdocs/index.html index 1b2b0c06..3d2619ad 100644 --- a/doc/htdocs/index.html +++ b/doc/htdocs/index.html @@ -47,15 +47,15 @@

Green Unicorn

-

Green Unicorn (gunicorn) is an HTTP/WSGI Server for UNIX designed to serve fast clients and nothing else.

+

Green Unicorn (gunicorn) is an HTTP/WSGI Server for UNIX designed to serve fast clients or sleepy applications.

This is a port of Unicorn in Python. Meet us on the #gunicorn IRC channel on Freenode.

Gunicorn is released under the MIT License. See the LICENSE for more details.

Features

    -
  • Designed for Unix, WSGI, and fast clients
  • +
  • Designed for Unix, WSGI, fast clients and sleepy applications.
  • Compatible with Python 2.x (>= 2.5)
  • -
  • Easy integration with Django and Paster compatible applications (Pylons, TurboGears 2, ...)
  • +
  • Easy integration with Django and Paster compatible applications (Pylons, TurboGears 2, ...)
  • Process management: Gunicorn reaps and restarts workers that die.
  • Load balancing via pre-fork and a shared socket
  • Graceful worker process restarts
  • @@ -63,9 +63,21 @@
  • Simple and easy Python configuration
  • Decode chunked transfers on-the-fly, allowing upload progress notifications or stream-based protocols over HTTP
  • +
  • Support for Eventlet and Gevent .
  • Post- and pre-fork hooks
+
+

Applications

+ +

Installing with easy_install

-

If you don't already have easy_install available you'll want to download and run the ez_setup.py script:

+

If you don't already have easy_install available you'll want to download and run the ez_setup.py script:

 $ curl -O http://peak.telecommunity.com/dist/ez_setup.py
 $ sudo python ez_setup.py -U setuptools
@@ -84,12 +84,22 @@ $ git clone git://github.com/benoitc/gunicorn.git
 
 $ python setup.py install
 
-

If you've cloned the git repository, its highly recommended that you use the develop command which will allow you to use Gunicorn from the source directory. This will allow you to keep up to date with development on GitHub as well as make changes to the source:

+

If you've cloned the git repository, its highly recommended that you use the develop command which will allow you to use Gunicorn from the source directory. This will allow you to keep up to date with development on GitHub as well as make changes to the source:

 $ python setup.py develop
 
+
+

Installing requirements for sleepy application handling

+

If you want to handle sleepy application you will need to install Eventlet or Gevent.

+

To install eventlet:

+
+$ easy_install -U eventlet
+
+

Replace eventlet by gevent if you want to use gevent.

+

You can now launch gunicorn with Eventlet or Gevent arbiter, see usage for more information.

+

Installing on Ubuntu/Debian systems

If you use ubuntu karmic, you can update your system with packages from our PPA by adding ppa:bchesneau/gunicorn to your system's Software Sources.

diff --git a/doc/htdocs/usage.html b/doc/htdocs/usage.html index a3423ef8..52c6c1c3 100644 --- a/doc/htdocs/usage.html +++ b/doc/htdocs/usage.html @@ -56,7 +56,7 @@

WSGI applications

-

Thirty seconds to launch the example application packaged with Gunicorn:

+

To launch the example application packaged with Gunicorn:

 $ cd /path/to/gunicorn/examples/
 $ gunicorn --workers=2 test:app
@@ -66,6 +66,12 @@ $ gunicorn --workers=2 test:app
 $ cd ~/
 $ gunicorn --workers=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
+
+

and then go on http://localhost:8000 to see the result.

Full command line usage

@@ -79,6 +85,9 @@ Options:
                         unix:/tmp/gunicorn.sock
   -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.