From 6f92b91c590c21e7289fdaabafe4f0c259ff1949 Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Fri, 7 May 2010 13:14:48 -0400 Subject: [PATCH] Add a bit of info to the virtualenv notes. --- doc/htdocs/deployment.html | 15 +++++++++++++-- doc/htdocs/faq.html | 14 +++++++------- doc/htdocs/installation.html | 10 +++++----- doc/htdocs/usage.html | 30 +++++++++++++++--------------- doc/site/deployment.rst | 11 +++++++++++ 5 files changed, 51 insertions(+), 29 deletions(-) diff --git a/doc/htdocs/deployment.html b/doc/htdocs/deployment.html index 250f83ee..85763288 100644 --- a/doc/htdocs/deployment.html +++ b/doc/htdocs/deployment.html @@ -135,8 +135,8 @@ http { features like Comet, Long polling, or Web sockets, you need to turn off the proxy buffering. When you do this you must run with one of the async worker classes.

-

To turn off buffering, you only need to add proxy_buffering off; to your -location block:

+

To turn off buffering, you only need to add proxy_buffering off; to your +location block:

 ...
 location / {
@@ -158,6 +158,17 @@ location / {
 

To serve an app from a Virtualenv it is generally easiest to just install Gunicorn directly into the Virtualenv. This will create a set of Gunicorn scripts for that Virtualenv which can be used to run applications normally.

+

If you have Virtualenv installed, you should be able to do something like +this:

+
+$ mkdir ~/venvs/
+$ virtualenv ~/venvs/webapp
+$ source ~/venvs/webapp/bin/activate
+$ ~/venvs/webapp/bin/easy_install -U gunicorn
+$ deactivate
+
+

Then you just need to use one of the thee Gunicorn scripts that was installed +into ~/venvs/webapp/bin.

Daemon Monitoring

diff --git a/doc/htdocs/faq.html b/doc/htdocs/faq.html index bc38c22e..6c8a0613 100644 --- a/doc/htdocs/faq.html +++ b/doc/htdocs/faq.html @@ -55,12 +55,12 @@ deployment page. Test some more.
What types of workers are there?

These can all be used with the -k option and specifying them -as egg:gunicorn#$(NAME) where $(NAME) is chosen from this list.

+as egg:gunicorn#$(NAME) where $(NAME) is chosen from this list.

    -
  • sync - The default synchronous worker
  • -
  • eventlet - Asynchronous workers based on Greenlets
  • -
  • gevent - Asynchronous workers based on Greenlets
  • -
  • tornado - Asynchronous workers based on FriendFeed's Tornado server.
  • +
  • sync - The default synchronous worker
  • +
  • eventlet - Asynchronous workers based on Greenlets
  • +
  • gevent - Asynchronous workers based on Greenlets
  • +
  • tornado - Asynchronous workers based on FriendFeed's Tornado server.
How might I test a proxy configuration?
@@ -87,8 +87,8 @@ $ kill -TTOU $masterpid
Start gunicorn with an approximate number of worker processes. Then use the TTIN and/or TTOU signals to adjust the number of workers under load.
How do I set SCRIPT_NAME?
-
By default SCRIPT_NAME is an empy string. The value could be set by -setting SCRIPT_NAME in the environment or as an HTTP header.
+
By default SCRIPT_NAME is an empy string. The value could be set by +setting SCRIPT_NAME in the environment or as an HTTP header.
How can I name processes?
You need to install the Python package setproctitle. Then you can specify a base process name on the command line (-n) or in the configuration diff --git a/doc/htdocs/installation.html b/doc/htdocs/installation.html index bad19e6f..fcacef43 100644 --- a/doc/htdocs/installation.html +++ b/doc/htdocs/installation.html @@ -59,8 +59,8 @@

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
@@ -89,7 +89,7 @@ $ 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 +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:

@@ -107,7 +107,7 @@ want to consider one of the alternate worker types.

 $ easy_install -U eventlet
 
-

Replace eventlet with gevent to use to the gevent based workers.

+

Replace eventlet with gevent to use to the gevent based workers.

Note

If you encounter errors when compiling the extensions for Eventlet or @@ -117,7 +117,7 @@ $ easy_install -U eventlet

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 +our PPA by adding ppa:bchesneau/gunicorn to your system's Software Sources.

Or this PPA can be added to your system manually by copying the lines below and adding them to your system's software sources:

diff --git a/doc/htdocs/usage.html b/doc/htdocs/usage.html index acaf82b1..0582749e 100644 --- a/doc/htdocs/usage.html +++ b/doc/htdocs/usage.html @@ -50,27 +50,27 @@

Usage

After installing Gunicorn you will have access to three command line scripts -that can be used for serving the various supported web frameworks: gunicorn, -gunicorn_django, and gunicorn_paster.

+that can be used for serving the various supported web frameworks: gunicorn, +gunicorn_django, and gunicorn_paster.

Commonly Used Arguments

    -
  • -c CONFIG, --config=CONFIG - Specify the path to a config file
  • -
  • -b BIND, --bind=BIND - Specify a server socket to bind. Server sockets -can be any of $(HOST), $(HOST):$(PORT), or unix:$(PATH). -An IP is a valid $(HOST).
  • -
  • -w WORKERS, --workers=WORKERS - The number of worker processes. This +
  • -c CONFIG, --config=CONFIG - Specify the path to a config file
  • +
  • -b BIND, --bind=BIND - Specify a server socket to bind. Server sockets +can be any of $(HOST), $(HOST):$(PORT), or unix:$(PATH). +An IP is a valid $(HOST).
  • +
  • -w WORKERS, --workers=WORKERS - The number of worker processes. This number should generally be between 2-4 workers per core in the server. Check the FAQ for ideas on tuning this parameter.
  • -
  • -k WORKERCLASS, --worker-class=WORKERCLASS - The type of worker process +
  • -k WORKERCLASS, --worker-class=WORKERCLASS - The type of worker process to run. You'll definitely want to read the production page for the implications of this parameter. You can set this to egg:gunicorn#$(NAME) -where $(NAME) is one of sync, eventlet, gevent, or -tornado. sync is the default.
  • -
  • -n APP_NAME, --name=APP_NAME - If setproctitle is installed you can +where $(NAME) is one of sync, eventlet, gevent, or +tornado. sync is the default.
  • +
  • -n APP_NAME, --name=APP_NAME - If setproctitle is installed you can adjust the name of Gunicorn process as they appear in the process system -table (which affects tools like ps and top).
  • +table (which affects tools like ps and top).

There are various other parameters that affect user privileges, logging, etc. @@ -86,7 +86,7 @@ that don't require a translation layer. Basic usage:

 $ gunicorn [OPTIONS] APP_MODULE
 
-

Where APP_MODULE is of the pattern $(MODULE_NAME):$(VARIABLE_NAME). The +

Where APP_MODULE is of the pattern $(MODULE_NAME):$(VARIABLE_NAME). The module name can be a full dotted path. The variable name refers to a WSGI callable that should be found in the specified module.

Example with test app:

@@ -102,7 +102,7 @@ applications. Basic usage:

 $ gunicorn_django [OPTIONS] [SETTINGS_PATH]
 
-

By default SETTINGS_PATH will look for settings.py in the current +

By default SETTINGS_PATH will look for settings.py in the current directory.

Example with your Django project:

@@ -111,7 +111,7 @@ $ gunicorn_django --workers=2
 

Alternatively, you can install some Gunicorn magic directly into your Django project and use the provided command for running the server.

-

First you'll need to add gunicorn to your INSTALLED_APPS in the settings +

First you'll need to add gunicorn to your INSTALLED_APPS in the settings file:

 INSTALLED_APPS = (
diff --git a/doc/site/deployment.rst b/doc/site/deployment.rst
index 67837d78..78ca4961 100644
--- a/doc/site/deployment.rst
+++ b/doc/site/deployment.rst
@@ -117,6 +117,17 @@ To serve an app from a Virtualenv_ it is generally easiest to just install
 Gunicorn directly into the Virtualenv. This will create a set of Gunicorn
 scripts for that Virtualenv which can be used to run applications normally.
 
+If you have Virtualenv installed, you should be able to do something like
+this::
+
+    $ mkdir ~/venvs/
+    $ virtualenv ~/venvs/webapp
+    $ source ~/venvs/webapp/bin/activate
+    $ ~/venvs/webapp/bin/easy_install -U gunicorn
+    $ deactivate
+
+Then you just need to use one of the thee Gunicorn scripts that was installed
+into ``~/venvs/webapp/bin``.
 
 Daemon Monitoring
 -----------------