diff --git a/docs/site/community.html b/docs/site/community.html index 8bdbf96c..f6fae4d4 100644 --- a/docs/site/community.html +++ b/docs/site/community.html @@ -1,73 +1,13 @@ - + + Green Unicorn - Community - -
- -
-
-
-

Mailing list

-

The user mailing list is general discussion and support list for -Gunicorn users.

-
- -
-

The archive for this list can also be browsed online .

-
-
-

Irc

-

The Gunicorn channel is on the Freenode IRC -network. You can chat with other on #gunicorn channel.

-
-
-

Issue Tracking

-

Bug reports, enhancement requests and tasks generally go in the Github -issue tracker.

-
-
-
-
-
-

Contents

- -
-
- -
+

+ Redirecting to here +

- \ No newline at end of file + diff --git a/docs/site/configuration.html b/docs/site/configuration.html index 63577a82..88bcf302 100644 --- a/docs/site/configuration.html +++ b/docs/site/configuration.html @@ -1,13 +1,13 @@ - - + + Green Unicorn - Configuration

- Redirecting to here + Redirecting to here

diff --git a/docs/site/configure.html b/docs/site/configure.html index 924ee13e..3028eb9c 100644 --- a/docs/site/configure.html +++ b/docs/site/configure.html @@ -1,771 +1,13 @@ - + + Green Unicorn - Configure - -
- -
-
-
-

Overview

-

Gunicorn pulls configuration information from three distinct places.

-

The first place that Gunicorn will read configuration from is the framework -specific configuration file. Currently this only affects Paster applications.

-

The second source of configuration information is a configuration file that is -optionally specified on the command line. Anything specified in the Gunicorn -config file will override any framework specific settings.

-

Lastly, the command line arguments used to invoke Gunicorn are the final place -considered for configuration settings. If an option is specified on the command -line, this is the value that will be used.

-
-
Once again, in order of least to most authoritative:
-
    -
  1. Framework Settings
  2. -
  3. Configuration File
  4. -
  5. Command Line
  6. -
-
-
-
-
-

Framework Settings

-

Currently, only Paster applications have access to framework specific -settings. If you have ideas for providing settings to WSGI applications or -pulling information from Django's settings.py feel free to open an issue to -let us know.

-
-

Paster Applications

-

In your INI file, you can specify to use Gunicorn as the server like such:

-
-[server:main]
-use = egg:gunicorn#main
-host = 192.168.0.1
-port = 80
-workers = 2
-proc_name = brim
-
-

Any parameters that Gunicorn knows about will automatically be inserted into -the base configuration. Remember that these will be overridden by the config -file and/or the command line.

-
-
-
-

Configuration File

-

The configuration file should be a valid Python source file. It only needs to -be readable from the file system. More specifically, it does not need to be -importable. Any Python is valid. Just consider that this will be run every time -you start Gunicorn (including when you signal Gunicorn to reload).

-

To set a parameter, just assign to it. There's no special syntax. The values -you provide will be used for the configuration values.

-

For instance:

-
-import multiprocessing
-
-bind = "127.0.0.1:8000"
-workers = multiprocessing.cpu_count() * 2 + 1
-
-

On a side note, Python's older than 2.6 can use sysconf to get the -number of processors:

-
-import os
-
-def numCPUs():
-    if not hasattr(os, "sysconf"):
-        raise RuntimeError("No sysconf detected.")
-    return os.sysconf("SC_NPROCESSORS_ONLN")
-
-
-
-

Command Line

-

If an option is specified on the command line, it overrides all other values -that may have been specified in the app specific settings, or in the optional -configuration file. Not all Gunicorn settings are available to be set from the -command line. To see the full list of command line settings you can do the -usual:

-
-$ gunicorn -h
-
-

There is also a --version flag available to the command line scripts that -isn't mentioned in the list of settings.

-
-
-

Settings

-

This is an exhaustive list of settings for Gunicorn. Some settings are only -able to be set from a configuration file. The setting name is what should be -used in the configuration file. The command line arguments are listed as well -for reference on setting at the command line.

-
-

Config File

-
-

config

-
    -
  • -c FILE, --config FILE
  • -
  • None
  • -
-

The path to a Gunicorn config file.

-

Only has an effect when specified on the command line or as part of an -application specific configuration.

-
-
-
-

Server Socket

-
-

bind

-
    -
  • -b ADDRESS, --bind ADDRESS
  • -
  • 127.0.0.1:8000
  • -
-

The socket to bind.

-

A string of the form: 'HOST', 'HOST:PORT', 'unix:PATH'. An IP is a valid -HOST.

-
-
-

backlog

-
    -
  • --backlog INT
  • -
  • 2048
  • -
-

The maximum number of pending connections.

-

This refers to the number of clients that can be waiting to be served. -Exceeding this number results in the client getting an error when -attempting to connect. It should only affect servers under significant -load.

-

Must be a positive integer. Generally set in the 64-2048 range.

-
-
-
-

Worker Processes

-
-

workers

-
    -
  • -w INT, --workers INT
  • -
  • 1
  • -
-

The number of worker process for handling requests.

-

A positive integer generally in the 2-4 x $(NUM_CORES) range. You'll -want to vary this a bit to find the best for your particular -application's work load.

-
-
-

worker_class

-
    -
  • -k STRING, --worker-class STRING
  • -
  • sync
  • -
-

The type of workers to use.

-

The default class (sync) should handle most 'normal' types of workloads. -You'll want to read http://gunicorn.org/design.html for information on -when you might want to choose one of the other worker classes.

-

A string referring to one of the following bundled classes:

-
    -
  • sync
  • -
  • eventlet - Requires eventlet >= 0.9.7
  • -
  • gevent - Requires gevent >= 0.12.2 (?)
  • -
  • tornado - Requires tornado >= 0.2
  • -
-

Optionally, you can provide your own worker by giving gunicorn a -python path to a subclass of gunicorn.workers.base.Worker. This -alternative syntax will load the gevent class: -gunicorn.workers.ggevent.GeventWorker. Alternatively the syntax -can also load the gevent class with egg:gunicorn#gevent

-
-
-

worker_connections

-
    -
  • --worker-connections INT
  • -
  • 1000
  • -
-

The maximum number of simultaneous clients.

-

This setting only affects the Eventlet and Gevent worker types.

-
-
-

max_requests

-
    -
  • --max-requests INT
  • -
  • 0
  • -
-

The maximum number of requests a worker will process before restarting.

-

Any value greater than zero will limit the number of requests a work -will process before automatically restarting. This is a simple method -to help limit the damage of memory leaks.

-

If this is set to zero (the default) then the automatic worker -restarts are disabled.

-
-
-

timeout

-
    -
  • -t INT, --timeout INT
  • -
  • 30
  • -
-

Workers silent for more than this many seconds are killed and restarted.

-

Generally set to thirty seconds. Only set this noticeably higher if -you're sure of the repercussions for sync workers. For the non sync -workers it just means that the worker process is still communicating and -is not tied to the length of time required to handle a single request.

-
-
-

graceful_timeout

-
    -
  • --graceful-timeout INT
  • -
  • 30
  • -
-

Timeout for graceful workers restart.

-

Generally set to thirty seconds. How max time worker can handle -request after got restart signal. If the time is up worker will -be force killed.

-
-
-

keepalive

-
    -
  • --keep-alive INT
  • -
  • 2
  • -
-

The number of seconds to wait for requests on a Keep-Alive connection.

-

Generally set in the 1-5 seconds range.

-
-
-
-

Security

-
-

limit_request_line

-
    -
  • --limit-request-line INT
  • -
  • 4094
  • -
-

The maximum size of HTTP request line in bytes.

-

This parameter is used to limit the allowed size of a client's -HTTP request-line. Since the request-line consists of the HTTP -method, URI, and protocol version, this directive places a -restriction on the length of a request-URI allowed for a request -on the server. A server needs this value to be large enough to -hold any of its resource names, including any information that -might be passed in the query part of a GET request. Value is a number -from 0 (unlimited) to 8190.

-

This parameter can be used to prevent any DDOS attack.

-
-
-

limit_request_fields

-
    -
  • --limit-request-fields INT
  • -
  • 100
  • -
-

Limit the number of HTTP headers fields in a request.

-

This parameter is used to limit the number of headers in a request to -prevent DDOS attack. Used with the limit_request_field_size it allows -more safety. By default this value is 100 and can't be larger than -32768.

-
-
-

limit_request_field_size

-
    -
  • --limit-request-field_size INT
  • -
  • 8190
  • -
-

Limit the allowed size of an HTTP request header field.

-

Value is a number from 0 (unlimited) to 8190. to set the limit -on the allowed size of an HTTP request header field.

-
-
-
-

Debugging

-
-

debug

-
    -
  • --debug
  • -
  • False
  • -
-

Turn on debugging in the server.

-

This limits the number of worker processes to 1 and changes some error -handling that's sent to clients.

-
-
-

spew

-
    -
  • --spew
  • -
  • False
  • -
-

Install a trace function that spews every line executed by the server.

-

This is the nuclear option.

-
-
-

check_config

-
    -
  • --check-config
  • -
  • False
  • -
-

Check the configuration..

-
-
-
-

Server Mechanics

-
-

preload_app

-
    -
  • --preload
  • -
  • False
  • -
-

Load application code before the worker processes are forked.

-

By preloading an application you can save some RAM resources as well as -speed up server boot times. Although, if you defer application loading -to each worker process, you can reload your application code easily by -restarting workers.

-
-
-

daemon

-
    -
  • -D, --daemon
  • -
  • False
  • -
-

Daemonize the Gunicorn process.

-

Detaches the server from the controlling terminal and enters the -background.

-
-
-

pidfile

-
    -
  • -p FILE, --pid FILE
  • -
  • None
  • -
-

A filename to use for the PID file.

-

If not set, no PID file will be written.

-
-
-

user

-
    -
  • -u USER, --user USER
  • -
  • 1000
  • -
-

Switch worker processes to run as this user.

-

A valid user id (as an integer) or the name of a user that can be -retrieved with a call to pwd.getpwnam(value) or None to not change -the worker process user.

-
-
-

group

-
    -
  • -g GROUP, --group GROUP
  • -
  • 1000
  • -
-

Switch worker process to run as this group.

-

A valid group id (as an integer) or the name of a user that can be -retrieved with a call to pwd.getgrnam(value) or None to not change -the worker processes group.

-
-
-

umask

-
    -
  • -m INT, --umask INT
  • -
  • 0
  • -
-

A bit mask for the file mode on files written by Gunicorn.

-

Note that this affects unix socket permissions.

-

A valid value for the os.umask(mode) call or a string compatible with -int(value, 0) (0 means Python guesses the base, so values like "0", -"0xFF", "0022" are valid for decimal, hex, and octal representations)

-
-
-

tmp_upload_dir

-
    -
  • None
  • -
-

Directory to store temporary request data as they are read.

-

This may disappear in the near future.

-

This path should be writable by the process permissions set for Gunicorn -workers. If not specified, Gunicorn will choose a system generated -temporary directory.

-
-
-

secure_scheme_headers

-
    -
  • {'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-SSL': 'on'}
  • -
-

A dictionary containing headers and values that the front-end proxy -uses to indicate HTTPS requests. These tell gunicorn to set -wsgi.url_scheme to "https", so your application can tell that the -request is secure.

-

The dictionary should map upper-case header names to exact string -values. The value comparisons are case-sensitive, unlike the header -names, so make sure they're exactly what your front-end proxy sends -when handling HTTPS requests.

-

It is important that your front-end proxy configuration ensures that -the headers defined here can not be passed directly from the client.

-
-
-

x_forwarded_for_header

-
    -
  • X-FORWARDED-FOR
  • -
-

Set the X-Forwarded-For header that identify the originating IP -address of the client connection to gunicorn via a proxy.

-
-
-
-

Logging

-
-

accesslog

-
    -
  • --access-logfile FILE
  • -
  • None
  • -
-

The Access log file to write to.

-

"-" means log to stderr.

-
-
-

access_log_format

-
    -
  • --access-logformat STRING
  • -
  • "%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"
  • -
-

The Access log format .

-

By default:

-

%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"

-

h: remote address -l: '-' -u: currently '-', may be user name in future releases -t: date of the request -r: status line (ex: GET / HTTP/1.1) -s: status -b: response length or '-' -f: referer -a: user agent -T: request time in seconds -D: request time in microseconds, -p: process ID -{Header}i: request header -{Header}o: response header

-
-
-

errorlog

-
    -
  • --error-logfile FILE, --log-file FILE
  • -
  • -
  • -
-

The Error log file to write to.

-

"-" means log to stderr.

-
-
-

loglevel

-
    -
  • --log-level LEVEL
  • -
  • info
  • -
-

The granularity of Error log outputs.

-

Valid level names are:

-
    -
  • debug
  • -
  • info
  • -
  • warning
  • -
  • error
  • -
  • critical
  • -
-
-
-

logger_class

-
    -
  • --logger-class STRING
  • -
  • simple
  • -
-

The logger you want to use to log events in gunicorn.

-

The default class (gunicorn.glogging.Logger) handle most of -normal usages in logging. It provides error and access logging.

-

You can provide your own worker by giving gunicorn a -python path to a subclass like gunicorn.glogging.Logger. -Alternatively the syntax can also load the Logger class -with egg:gunicorn#simple

-
-
-

logconfig

-
    -
  • --log-config FILE
  • -
  • None
  • -
-

The log config file to use. -Gunicorn uses the standard Python logging module's Configuration -file format.

-
-
-
-

Process Naming

-
-

proc_name

-
    -
  • -n STRING, --name STRING
  • -
  • None
  • -
-

A base to use with setproctitle for process naming.

-

This affects things like ps and top. If you're going to be -running more than one instance of Gunicorn you'll probably want to set a -name to tell them apart. This requires that you install the setproctitle -module.

-

It defaults to 'gunicorn'.

-
-
-

default_proc_name

-
    -
  • gunicorn
  • -
-

Internal setting that is adjusted for each type of application.

-
-
-
-

Django

-
-

django_settings

-
    -
  • --settings STRING
  • -
  • None
  • -
-

The Python path to a Django settings module.

-

e.g. 'myproject.settings.main'. If this isn't provided, the -DJANGO_SETTINGS_MODULE environment variable will be used.

-
-
-

pythonpath

-
    -
  • --pythonpath STRING
  • -
  • None
  • -
-

A directory to add to the Python path for Django.

-

e.g. -'/home/djangoprojects/myproject'.

-
-
-
-

Server Hooks

-
-

on_starting

-
    -
  • -def on_starting(server):
    -    pass
    -
    -
  • -
-

Called just before the master process is initialized.

-

The callable needs to accept a single instance variable for the Arbiter.

-
-
-

on_reload

-
    -
  • -def on_reload(server):
    -    pass
    -
    -
  • -
-

Called to recycle workers during a reload via SIGHUP.

-

The callable needs to accept a single instance variable for the Arbiter.

-
-
-

when_ready

-
    -
  • -def when_ready(server):
    -    pass
    -
    -
  • -
-

Called just after the server is started.

-

The callable needs to accept a single instance variable for the Arbiter.

-
-
-

pre_fork

-
    -
  • -def pre_fork(server, worker):
    -    pass
    -
    -
  • -
-

Called just before a worker is forked.

-

The callable needs to accept two instance variables for the Arbiter and -new Worker.

-
-
-

post_fork

-
    -
  • -def post_fork(server, worker):
    -    pass
    -
    -
  • -
-

Called just after a worker has been forked.

-

The callable needs to accept two instance variables for the Arbiter and -new Worker.

-
-
-

pre_exec

-
    -
  • -def pre_exec(server):
    -    pass
    -
    -
  • -
-

Called just before a new master process is forked.

-

The callable needs to accept a single instance variable for the Arbiter.

-
-
-

pre_request

-
    -
  • -def pre_request(worker, req):
    -    worker.log.debug("%s %s" % (req.method, req.path))
    -
    -
  • -
-

Called just before a worker processes the request.

-

The callable needs to accept two instance variables for the Worker and -the Request.

-
-
-

post_request

-
    -
  • -def post_request(worker, req, environ):
    -    pass
    -
    -
  • -
-

Called after a worker processes the request.

-

The callable needs to accept two instance variables for the Worker and -the Request.

-
-
-

worker_exit

-
    -
  • -def worker_exit(server, worker):
    -    pass
    -
    -
  • -
-

Called just after a worker has been exited.

-

The callable needs to accept two instance variables for the Arbiter and -the just-exited Worker.

-
-
-
-
-
-
- -
- -
+

+ Redirecting to here +

- \ No newline at end of file + diff --git a/docs/site/css/index.css b/docs/site/css/index.css deleted file mode 100644 index b67b2673..00000000 --- a/docs/site/css/index.css +++ /dev/null @@ -1,253 +0,0 @@ -/* line 17, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font: inherit; - font-size: 100%; - vertical-align: baseline; -} - -/* line 22, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -html { - line-height: 1; -} - -/* line 24, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -ol, ul { - list-style: none; -} - -/* line 26, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -table { - border-collapse: collapse; - border-spacing: 0; -} - -/* line 28, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -caption, th, td { - text-align: left; - font-weight: normal; - vertical-align: middle; -} - -/* line 30, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -q, blockquote { - quotes: none; -} -/* line 103, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -q:before, q:after, blockquote:before, blockquote:after { - content: ""; - content: none; -} - -/* line 32, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -a img { - border: none; -} - -/* line 116, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary { - display: block; -} - -/* line 15, ../../css/index.sass */ -#container.landing { - margin-left: auto; - margin-right: auto; - width: 960px; -} -/* line 17, ../../css/index.sass */ -#container.landing #menu, #container.landing #header, #container.landing div.blurb, #container.landing #tutorial, #container.landing #actions, #container.landing #footer { - display: inline; - float: left; - margin-left: 10px; - margin-right: 10px; -} -/* line 19, ../../css/index.sass */ -#container.landing #menu, #container.landing #header, #container.landing #footer { - width: 940px; -} -/* line 22, ../../css/index.sass */ -#container.landing div.blurb { - width: 300px; -} -/* line 24, ../../css/index.sass */ -#container.landing #tutorial { - width: 620px; -} - -/* line 4, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -body { - font: 13px/1.5 Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif; -} - -/* line 6, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -a:focus { - outline: 1px dotted invert; -} - -/* line 8, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -hr { - border-color: #cccccc; - border-style: solid; - border-width: 1px 0 0; - clear: both; - height: 0; -} - -/* line 14, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h1 { - font-size: 25px; -} - -/* line 16, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h2 { - font-size: 23px; -} - -/* line 18, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h3 { - font-size: 21px; -} - -/* line 20, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h4 { - font-size: 19px; -} - -/* line 22, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h5 { - font-size: 17px; -} - -/* line 24, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h6 { - font-size: 15px; -} - -/* line 26, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -ol { - list-style: decimal; -} - -/* line 28, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -ul { - list-style: square; -} - -/* line 30, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -li { - margin-left: 30px; -} - -/* line 32, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -p, -dl, -hr, -h1, -h2, -h3, -h4, -h5, -h6, -ol, -ul, -pre, -table, -address, -fieldset { - margin-bottom: 20px; -} - -/* line 29, ../../css/index.sass */ -a, a:visited, a:hover, a:active { - color: #569633; - text-decoration: none; -} - -/* line 33, ../../css/index.sass */ -#header { - margin: 46px 0px; -} - -/* line 36, ../../css/index.sass */ -#menu { - margin-bottom: 23px; - -moz-border-radius-bottomleft: 10px; - -webkit-border-bottom-left-radius: 10px; - border-bottom-left-radius: 10px; - -moz-border-radius-bottomright: 10px; - -webkit-border-bottom-right-radius: 10px; - border-bottom-right-radius: 10px; - background-color: #959595; - text-align: right; -} -/* line 41, ../../css/index.sass */ -#menu div.logo { - float: left; - margin-left: 10px; - padding-top: 3px; -} -/* line 45, ../../css/index.sass */ -#menu ul { - display: inline; - margin-right: 10px; - list-style: none; -} -/* line 11, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/typography/lists/_bullets.scss */ -#menu ul li { - list-style-image: none; - list-style-type: none; - margin-left: 0; -} -/* line 49, ../../css/index.sass */ -#menu ul li { - display: inline; - padding: 0px 3px; -} -/* line 52, ../../css/index.sass */ -#menu ul li a { - font-size: 17px; - color: white; -} - -/* line 56, ../../css/index.sass */ -#footer { - border-top: 1px solid #959595; - padding: 10px 0px; - text-align: center; - color: #959595; -} -/* line 61, ../../css/index.sass */ -#footer p { - margin-bottom: 5px; -} - -/* line 64, ../../css/index.sass */ -pre, tt, code { - font-family: "Andale Mono", "Lucida Console", monospace; - font-size: 12px; -} - -/* line 68, ../../css/index.sass */ -pre { - white-space: pre; - background-color: black; - color: lime; - margin: 5px; - margin-bottom: 20px; - padding: 5px; -} diff --git a/docs/site/css/style.css b/docs/site/css/style.css index 0f7cc672..7803d57d 100644 --- a/docs/site/css/style.css +++ b/docs/site/css/style.css @@ -1,309 +1,392 @@ -/* line 17, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font: inherit; - font-size: 100%; - vertical-align: baseline; +html,body { + margin: 0; + padding: 0; +} + +h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,cite, +code,del,dfn,em,img,q,s,samp,small,strike,strong,sub,sup,tt,var, +dd,dl,dt,li,ol,ul,fieldset,form,label,legend,button,table,caption, +tbody,tfoot,thead,tr,th,td { + margin: 0; + padding: 0; + border: 0; + font: inherit; + vertical-align: baseline; +} + +ol,ul { + list-style: none; } -/* line 22, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ html { - line-height: 1; + overflow-y: scroll; + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; } -/* line 24, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -ol, ul { - list-style: none; +a:hover, a:active, a:focus { + outline: 0; } -/* line 26, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -table { - border-collapse: collapse; - border-spacing: 0; +img { + border: 0; + -ms-interpolation-mode: bicubic; } -/* line 28, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -caption, th, td { - text-align: left; - font-weight: normal; - vertical-align: middle; -} - -/* line 30, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -q, blockquote { - quotes: none; -} -/* line 103, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -q:before, q:after, blockquote:before, blockquote:after { - content: ""; - content: none; -} - -/* line 32, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -a img { - border: none; -} - -/* line 116, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary { - display: block; -} - -/* line 15, ../../css/style.sass */ -#container.twocolumn { - margin-left: auto; - margin-right: auto; - width: 960px; -} -/* line 17, ../../css/style.sass */ -#container.twocolumn #header, #container.twocolumn #menu, #container.twocolumn #footer, #container.twocolumn #toc, #container.twocolumn #content { - display: inline; - float: left; - margin-left: 10px; - margin-right: 10px; -} -/* line 19, ../../css/style.sass */ -#container.twocolumn #header, #container.twocolumn #menu, #container.twocolumn #footer { - width: 940px; -} -/* line 21, ../../css/style.sass */ -#container.twocolumn #toc { - width: 300px; -} -/* line 23, ../../css/style.sass */ -#container.twocolumn #content { - width: 620px; -} - -/* line 4, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ body { - font: 13px/1.5 Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif; + background: #F8F8F3; + margin: 0; + font: 14px/1.4 "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, "Lucida Grande", sans-serif; + color: #67686B; + height: auto; } -/* line 6, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -a:focus { - outline: 1px dotted invert; +a, +a:hover { + text-decoration: none; } -/* line 8, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -hr { - border-color: #cccccc; - border-style: solid; - border-width: 1px 0 0; - clear: both; - height: 0; +.clearall { + clear: both; + display: block; + overflow: hidden; + visibility: hidden; + width: 0; + height: 0; } -/* line 14, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h1 { - font-size: 25px; +.logo-wrapper { + border-bottom: 1px solid #2A8729; } -/* line 16, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h2 { - font-size: 23px; +.logo-div { + width: 1000px; + margin: 0 auto; + padding: 5px; + height: 72px; } -/* line 18, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h3 { - font-size: 21px; +.logo { + width: 250px; + margin: 0 auto; + height: 119px; + background: url(../images/logo-bottom.png) no-repeat bottom center; + position: relative; + z-index: 99999; } -/* line 20, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h4 { - font-size: 19px; +.banner-wrapper { + background: url(../images/banner-bg.jpg) repeat; + display: block; + width: 100%; + min-height: 365px; + margin-top: 1px; + margin-bottom: 1px; } -/* line 22, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h5 { - font-size: 17px; +.banner { + width: 1000px; + margin: 0 auto; + padding: 15px; } -/* line 24, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -h6 { - font-size: 15px; +.title { + width: 250px; + margin: 0 auto; + margin-top: 32px; + text-align:center; } -/* line 26, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -ol { - list-style: decimal; +.banner h1 { + font-size: 20px; + font-weight: lighter; + color: #FFF; + margin: 15px 10px 0; + padding: 5px 40px; + text-align: center; + line-height: 28px; } -/* line 28, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -ul { - list-style: square; +.greenbutton { + background: url(../images/greenbutton.jpg) repeat-x; + height: 54px; + width: 224px; + line-height: 54px; + display: inline-block; + text-align: center; + border-radius: 3px; + border: solid 1px #1D692D; + color: #fff; + font-size: 22px; + letter-spacing: 1px; + text-shadow: 1px 1px 1px #000; } -/* line 30, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -li { - margin-left: 30px; +.greenbutton:hover { + background: url(../images/greenbutton.jpg) repeat-x bottom; } -/* line 32, /Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.10.4/stylesheets/960/_text.sass */ -p, -dl, -hr, -h1, -h2, -h3, -h4, -h5, -h6, -ol, -ul, -pre, -table, -address, -fieldset { - margin-bottom: 20px; +.redbutton { + background: url(../images/redbutton.jpg) repeat-x; + height: 54px; + width: 224px; + line-height: 54px; + display: inline-block; + text-align: center; + border-radius: 3px; + border: solid 1px #7D180A; + color: #fff; + font-size: 22px; + letter-spacing: 1px; + text-shadow: 1px 1px 1px #000; } -/* line 30, ../../css/style.sass */ -body { - font-family: Helvetica, Arial, sans-serif; +.redbutton:hover { + background: url(../images/redbutton.jpg) repeat-x bottom; } -/* line 33, ../../css/style.sass */ -a, a:visited, a:hover, a:active { - color: #569633; - text-decoration: none; +.banner-button { + width: 460px; + margin: 0 auto; + margin-top: 30px; } -/* line 39, ../../css/style.sass */ -#menu { - margin-bottom: 23px; - -moz-border-radius-bottomleft: 10px; - -webkit-border-bottom-left-radius: 10px; - border-bottom-left-radius: 10px; - -moz-border-radius-bottomright: 10px; - -webkit-border-bottom-right-radius: 10px; - border-bottom-right-radius: 10px; - background-color: #959595; - text-align: right; -} -/* line 44, ../../css/style.sass */ -#menu div.logo { - float: left; - margin-left: 10px; - padding-top: 3px; -} -/* line 48, ../../css/style.sass */ -#menu ul { - display: inline; - margin-right: 10px; - list-style: none; -} -/* line 11, /Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/typography/lists/_bullets.scss */ -#menu ul li { - list-style-image: none; - list-style-type: none; - margin-left: 0; -} -/* line 52, ../../css/style.sass */ -#menu ul li { - display: inline; - padding: 0px 3px; -} -/* line 55, ../../css/style.sass */ -#menu ul li a { - font-size: 17px; - color: white; +.banner-link { + width: 250px; + margin: 0 auto; + margin-top: 15px; + padding: 5px; + text-align: center; } -/* line 59, ../../css/style.sass */ -div.document { - border-right: 1px solid #959595; - padding-right: 15px; +.banner-link a { + color: #fff; + font-weight: 700; + letter-spacing: 1px; } -/* line 64, ../../css/style.sass */ -#toc ul ul { - list-style: disc; -} -/* line 66, ../../css/style.sass */ -#toc ul ul ul { - list-style: circle; +.banner-link a:hover { + color: #000; } -/* line 69, ../../css/style.sass */ -p.topic-title { - display: none; +.mid-wrapper { + width: 100%; + border-top: 1px solid #2A8729; + padding-top: 15px; } -/* line 72, ../../css/style.sass */ -pre, tt, code { - font-family: "Andale Mono", "Lucida Console", monospace; - font-size: 12px; +.tabs { + width: 1000px; + margin: 0 auto; + padding: 3px; + margin-top: 5px; + margin-bottom: 25px; +} + +.tab-bar li { + width: 230px; + padding: 3px; + text-align: center; + float: left; + margin-right: 5px; + margin-left: 6px; +} + +.tab-bar li a { + display: inline-block; +} + +.tab-bar li a:hover > p, +.tab-bar li a:hover > h2 { + color: #1D692D; +} + +.tab-bar li a p, +.tab-bar li a h2 { + color: #404028; + margin-top: 8px; + line-height: 1.2; +} + +.tab-bar li a h2 { + font-weight: 700; + text-transform: uppercase; +} + +.withborder { + background: url(../images/separator.jpg) no-repeat; +} + +.gabout, .gcommunity, .gdownloads, .gdocuments { + height: 80px; + width: 230px; + padding-top: 118px; +} + +.gabout { + background: url(../images/about.jpg) no-repeat 50% 0; +} + +.gcommunity { + background: url(../images/community.jpg) no-repeat 50% 0; +} + +.gdocuments { + background: url(../images/documents.jpg) no-repeat 50% 0; +} + +.gdownloads { + background: url(../images/downloads.jpg) no-repeat 50% 0; +} + +.tabs li.active a, +.gabout:hover, +.gcommunity:hover, +.gdocuments:hover, +.gdownloads:hover { + background-position: 50% -220px; +} + +.tabs div { + display:none; +} + +.tabs div.active { + display: block; +} + +.tab-box { + color: #3F3F27; + border: 1px solid #DDDDD5; + padding: 25px 35px; + position: relative; + margin-top: 20px; + border-radius: 3px; +} + +.tab-box h1 { + font-size: 28px; + color: #2A8729; +} + +.tab-box p { + margin: 0 0 9px; +} + +.tab-box ul { + padding-left: 40px; +} + +.tab-box li { + list-style: disc; + margin: 0 0 9px; +} + +.tab-box a { + color: #3F3F27; + text-decoration: underline; +} + +.tab-box a:hover { + color: #1D692D; +} + +.arrow { + background: url(../images/arrow.png) no-repeat; + position: absolute; + left: 115px; + top: -7px; + height: 10px; + width: 20px; } -/* line 76, ../../css/style.sass */ pre { - white-space: pre; - background-color: black; - color: lime; - margin: 5px; - margin-bottom: 20px; - padding: 5px; + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 14px; + color: #333333; + display: block; + padding: 8.5px; + margin: 0 0 9px; + font-size: 14px; + line-height: 18px; + word-break: break-all; + word-wrap: break-word; + white-space: pre; + white-space: pre-wrap; + background-color: #EEFFCC; + border-top: 1px solid #A9CC99; + border-bottom: 1px solid #A9CC99; } -/* line 84, ../../css/style.sass */ -.note { - border-top: 1px solid #569633; - border-bottom: 1px solid #569633; - padding: 0.6em 0.6em 0.6em 80px; - margin-bottom: 2em; - position: relative; -} -/* line 90, ../../css/style.sass */ -.note p.admonition-title:before { - content: "!"; - font-size: 60px; - font-weight: bold; - color: red; - position: absolute; - left: 30px; - font-family: helvetica, arial; -} -/* line 98, ../../css/style.sass */ -.note p.admonition-title { - font-weight: 700; - margin: 0; - margin-bottom: 4px; - padding: 0; -} -/* line 103, ../../css/style.sass */ -.note p.last { - padding: 0; - margin: 0; +.user-wrapper { + background: url(../images/banner-bg.jpg) repeat; + height: 110px; } -/* line 107, ../../css/style.sass */ -#footer { - border-top: 1px solid #959595; - padding: 10px 0px; - text-align: center; - color: #959595; -} -/* line 112, ../../css/style.sass */ -#footer p { - margin-bottom: 5px; +.users { + width: 1000px; + padding: 20px 5px; + margin: 0 auto; + color: #fff; } -/* line 115, ../../css/style.sass */ -strong { - font-weight: bold; +.users h3 { + font-size: 12px; + margin-left: 5px; + padding-top: 15px; } + +.users h2 { + font-size: 26px; + margin-left: 5px; +} + +.users .left-details { + width: 120px; + float: left; + height: 66px; + background: url(../images/footer-arrow.png) no-repeat top right; + padding-right: 15px; + text-align: right; +} + +.users .company-logos { + float: left; + width: 820px; + height: 70px; + margin-left: 20px; +} + +.users .company-logos a img { + float: left; + border: solid 1px #004000; + margin: 0 6px; +} + +.users .company-logos a:hover img { + border: solid 1px #000; +} + +.footer { + background-color: #F8F8F3; + display: block; + height: 70px; +} + +.footer .footer-wp { + margin: 0 auto; + padding: 15px 5px; + width: 930px; + background: url(../images/footer-logo.jpg) no-repeat 0 50%; + padding-left: 70px; +} + +.footer-wp a { + color: #3F3F27; + text-decoration: underline; +} + +.footer-wp a:hover { + color: #1D692D; +} \ No newline at end of file diff --git a/docs/site/deploy.html b/docs/site/deploy.html index 85ef8335..97568d2e 100644 --- a/docs/site/deploy.html +++ b/docs/site/deploy.html @@ -1,220 +1,13 @@ - - Green Unicorn - Deploy - + + + Green Unicorn - Deployment -
- -
-
-
-

Nginx Configuration

-

Although there are many HTTP proxies available, we strongly advise that you -use Nginx. If you choose another proxy server you need to make sure that it -buffers slow clients when you use default Gunicorn workers. Without this -buffering Gunicorn will be easily susceptible to denial-of-service attacks. -You can use slowloris to check if your proxy is behaving properly.

-

An example configuration file for fast clients with Nginx:

-
-worker_processes 1;
-
-user nobody nogroup;
-pid /tmp/nginx.pid;
-error_log /tmp/nginx.error.log;
-
-events {
-    worker_connections 1024;
-    accept_mutex off;
-}
-
-http {
-    include mime.types;
-    default_type application/octet-stream;
-    access_log /tmp/nginx.access.log combined;
-    sendfile on;
-
-    upstream app_server {
-        server unix:/tmp/gunicorn.sock fail_timeout=0;
-        # For a TCP configuration:
-        # server 192.168.0.7:8000 fail_timeout=0;
-    }
-
-    server {
-        listen 80 default;
-        client_max_body_size 4G;
-        server_name _;
-
-        keepalive_timeout 5;
-
-
-        location ^~ /static {
-            # path for static files
-            alias /path/to/app/current/public/static;
-        }
-
-        location / {
-            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-            proxy_set_header Host $http_host;
-            proxy_redirect off;
-
-            proxy_pass   http://app_server;
-        }
-
-        error_page 500 502 503 504 /500.html;
-        location = /500.html {
-            root /path/to/app/current/public;
-        }
-    }
-}
-
-

If you want to be able to handle streaming request/responses or other fancy -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:

-
-...
-location / {
-    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-    proxy_set_header Host $http_host;
-    proxy_redirect off;
-    proxy_buffering off;
-
-    if (!-f $request_filename) {
-        proxy_pass http://app_server;
-        break;
-    }
-}
-...
-
-
-
-

Using Virtualenv

-

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 three Gunicorn scripts that was installed -into ~/venvs/webapp/bin.

-

Note: You can force the installation of Gunicorn in your Virtualenv by -passing -I or --ignore-installed option to pip:

-
-$ source ~/venvs/webapp/bin/activate
-$ pip install -I gunicorn
-
-
-
-

Monitoring

-
-

Note

-

Make sure that when using either of these service monitors you do not -enable the Gunicorn's daemon mode. These monitors expect that the process -they launch will be the process they need to monior. Daemonizing -will fork-exec which creates an unmonitored process and generally just -confuses the monitor services.

-
-
-

Runit

-

A popular method for deploying Gunicorn is to have it monitored by runit. -Here is an example service definition:

-
-#!/bin/sh
-
-GUNICORN=/usr/local/bin/gunicorn
-ROOT=/path/to/project
-PID=/var/run/gunicorn.pid
-
-APP=main:application
-
-if [ -f $PID ]; then rm $PID; fi
-
-cd $ROOT
-exec $GUNICORN -c $ROOT/gunicorn.conf.py --pid=$PID $APP
-
-

Save this as /etc/sv/[app_name]/run, and make it executable -(chmod u+x /etc/sv/[app_name]/run). -Then run ln -s /etc/sv/[app_name] /etc/service/[app_name]. -If runit is installed, gunicorn should start running automatically as soon -as you create the symlink.

-

If it doesn't start automatically, run the script directly to troubleshoot.

-
-
-

Supervisor

-

Another useful tool to monitor and control Gunicorn is Supervisor. A -simple configuration is:

-
-[program:gunicorn]
-command=/path/to/gunicorn main:application -c /path/to/gunicorn.conf.py
-directory=/path/to/project
-user=nobody
-autostart=true
-autorestart=true
-redirect_stderr=True
-
-
-
-
-

Logging

-

Logging can be configured by using various flags detailed in the -configuration documentation or by creating a logging configuration file. -Send the USR1 signal to rotate logs if you are using the logrotate -utility:

-
-kill -USR1 $(cat /var/run/gunicorn.pid)
-
-
-
-
-
- -
- -
+

+ Redirecting to here +

diff --git a/docs/site/deployment.html b/docs/site/deployment.html index 65b90c65..2ccee4bb 100644 --- a/docs/site/deployment.html +++ b/docs/site/deployment.html @@ -1,12 +1,13 @@ + - - - Green Unicorn - Deploy + + + Green Unicorn - Deployment

- Redirecting to here + Redirecting to here

- + \ No newline at end of file diff --git a/docs/site/design.html b/docs/site/design.html index c7f238e5..38f04705 100644 --- a/docs/site/design.html +++ b/docs/site/design.html @@ -1,133 +1,13 @@ - + + Green Unicorn - Design - -
- -
-
-
-

Server Model

-

Gunicorn is based on the pre-fork worker model. This means that there is a -central master process that manages a set of worker processes. The master -never knows anything about individual clients. All requests and responses are -handled completely by worker processes.

-
-

Master

-

The master process is a simple loop that listens for various process signals -and reacts accordingly. It manages the list of running workers by listening -for signals like TTIN, TTOU, and CHLD. TTIN and TTOU tell the master to -increase or decrease the number of running workers. CHLD indicates that a child -process has terminated, in this case the master process automatically restarts -the failed worker.

-
-
-

Sync Workers

-

The most basic and the default worker type is a synchronous worker class that -handles a single request at a time. This model is the simplest to reason about -as any errors will affect at most a single request. Though as we describe below -only processing a single request at a time requires some assumptions about how -applications are programmed.

-
-
-

Async Workers

-

The asynchronous workers available are based on Greenlets (via Eventlet and -Gevent). Greenlets are an implementation of cooperative multi-threading for -Python. In general, an application should be able to make use of these worker -classes with no changes.

-
-
-

Tornado Workers

-

There's also a Tornado worker class. It can be used to write applications using -the Tornado framework. Although the Tornado workers are capable of serving a -WSGI application, this is not a recommended configuration.

-
-
-
-

Choosing a Worker Type

-

The default synchronous workers assume that your application is resource bound -in terms of CPU and network bandwidth. Generally this means that your -application shouldn't do anything that takes an undefined amount of time. For -instance, a request to the internet meets this criteria. At some point the -external network will fail in such a way that clients will pile up on your -servers.

-

This resource bound assumption is why we require a buffering proxy in front of a -default configuration Gunicorn. If you exposed synchronous workers to the -internet, a DOS attack would be trivial by creating a load that trickles data to -the servers. For the curious, Slowloris is an example of this type of load.

-

Some examples of behavior requiring asynchronous workers:

-
-
    -
  • Applications making long blocking calls (Ie, external web services)
  • -
  • Serving requests directly to the internet
  • -
  • Streaming requests and responses
  • -
  • Long polling
  • -
  • Web sockets
  • -
  • Comet
  • -
-
-
-
-

How Many Workers?

-

DO NOT scale the number of workers to the number of clients you expect to have. -Gunicorn should only need 4-12 worker processes to handle hundreds or thousands -of requests per second.

-

Gunicorn relies on the operating system to provide all of the load balancing -when handling requests. Generally we recommend (2 x $num_cores) + 1 as the -number of workers to start off with. While not overly scientific, the formula -is based on the assumption that for a given core, one worker will be reading -or writing from the socket while the other worker is processing a request.

-

Obviously, your particular hardware and application are going to affect the -optimal number of workers. Our recommendation is to start with the above guess -and tune using TTIN and TTOU signals while the application is under load.

-

Always remember, there is such a thing as too many workers. After a point your -worker processes will start thrashing system resources decreasing the throughput -of the entire system.

-
-
-
-
- -
- -
+

+ Redirecting to here +

- \ No newline at end of file + diff --git a/docs/site/faq.html b/docs/site/faq.html index 7474a2b9..5dbdc0b1 100644 --- a/docs/site/faq.html +++ b/docs/site/faq.html @@ -1,168 +1,13 @@ - + + Green Unicorn - FAQ - -
- -
-
-
-

WSGI Bits

-
-

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.

-
-
-
-

Server Stuff

-
-

How do I reload my application in Gunicorn?

-

You can gracefully reload by sending HUP signal to gunicorn:

-
-$ kill -HUP masterpid
-
-
-
-

How might I test a proxy configuration?

-

The Slowloris script is a great way to test that your proxy is correctly -buffering responses for the synchronous workers.

-
-
-

How can I name processes?

-

If you install the Python package setproctitle Gunicorn will set the process -names to something a bit more meaningful. This will affect the output you see -in tools like ps and top. This helps for distinguishing the master -process as well as between masters when running more than one app on a single -machine. See the proc_name setting for more information.

-
-
-

Gunicorn fails to start with upstart

-

Make sure you run gunicorn with --daemon option.

-
-
-

Why is there no HTTP Keep-Alive?

-

The default Sync workers are designed to run behind Nginx which only uses -HTTP/1.0 with its upstream servers. If you want to deploy Gunicorn to -handle unbuffered requests (ie, serving requests directly from the internet) -you should use one of the async workers.

-
-
-
-

Worker Processes

-
-

How do I know which type of worker to use?

-

Read the design page for help on the various worker types.

-
-
-

What types of workers are there?

-

Check out the configuration docs for worker_class

-
- -
-

How can I change the number of workers dynamically?

-

TTIN and TTOU signals can be sent to the master to increase or decrease -the number of workers.

-

To increase the worker count by one:

-
-$ kill -TTIN $masterpid
-
-

To decrease the worker count by one:

-
-$ kill -TTOU $masterpid
-
-
-
-
-

Kernel Parameters

-

When dealing with large numbers of concurrent connections there are a handful of -kernel parameters that you might need to adjust. Generally these should only -affect sites with a very large concurrent load. These parameters are not -specific to Gunicorn, they would apply to any sort of network server you may be -running.

-

These commands are for Linux. Your particular OS may have slightly different -parameters.

-
-

How can I increase the maximum number of file descriptors?

-

One of the first settings that usually needs to be bumped is the maximum number -of open file descriptors for a given process. For the confused out there, -remember that Unices treat sockets as files.

-
-$ sudo ulimit -n 2048
-
-
-
-

How can I increase the maximum socket backlog?

-

Listening sockets have an associated queue of incoming connections that are -waiting to be accepted. If you happen to have a stampede of clients that fill up -this queue new connections will eventually start getting dropped.

-
-$ sudo sysctl -w net.core.somaxconn="2048"
-
-
-
-
-
-
- -
- -
+

+ Redirecting to here +

- \ No newline at end of file + diff --git a/docs/site/images/about.jpg b/docs/site/images/about.jpg new file mode 100644 index 00000000..4aab4d50 Binary files /dev/null and b/docs/site/images/about.jpg differ diff --git a/docs/site/images/arrow.png b/docs/site/images/arrow.png new file mode 100644 index 00000000..754d3091 Binary files /dev/null and b/docs/site/images/arrow.png differ diff --git a/docs/site/images/banner-bg.jpg b/docs/site/images/banner-bg.jpg new file mode 100644 index 00000000..0ba44ffa Binary files /dev/null and b/docs/site/images/banner-bg.jpg differ diff --git a/docs/site/images/community.jpg b/docs/site/images/community.jpg new file mode 100644 index 00000000..0cda8a88 Binary files /dev/null and b/docs/site/images/community.jpg differ diff --git a/docs/site/images/documents.jpg b/docs/site/images/documents.jpg new file mode 100644 index 00000000..d96d8ca9 Binary files /dev/null and b/docs/site/images/documents.jpg differ diff --git a/docs/site/images/downloads.jpg b/docs/site/images/downloads.jpg new file mode 100644 index 00000000..9c4f9373 Binary files /dev/null and b/docs/site/images/downloads.jpg differ diff --git a/docs/site/images/favicon.png b/docs/site/images/favicon.png new file mode 100644 index 00000000..63bef255 Binary files /dev/null and b/docs/site/images/favicon.png differ diff --git a/docs/site/images/footer-arrow.png b/docs/site/images/footer-arrow.png new file mode 100644 index 00000000..483639f4 Binary files /dev/null and b/docs/site/images/footer-arrow.png differ diff --git a/docs/site/images/footer-logo.jpg b/docs/site/images/footer-logo.jpg new file mode 100644 index 00000000..cf6e5e39 Binary files /dev/null and b/docs/site/images/footer-logo.jpg differ diff --git a/docs/site/images/greenbutton.jpg b/docs/site/images/greenbutton.jpg new file mode 100644 index 00000000..0f8d7ac3 Binary files /dev/null and b/docs/site/images/greenbutton.jpg differ diff --git a/docs/site/images/logo-bottom.png b/docs/site/images/logo-bottom.png new file mode 100644 index 00000000..9264bed9 Binary files /dev/null and b/docs/site/images/logo-bottom.png differ diff --git a/docs/site/images/logo.jpg b/docs/site/images/logo.jpg new file mode 100644 index 00000000..f96c50cf Binary files /dev/null and b/docs/site/images/logo.jpg differ diff --git a/docs/site/images/redbutton.jpg b/docs/site/images/redbutton.jpg new file mode 100644 index 00000000..735f7304 Binary files /dev/null and b/docs/site/images/redbutton.jpg differ diff --git a/docs/site/images/separator.jpg b/docs/site/images/separator.jpg new file mode 100644 index 00000000..6e6cbb8b Binary files /dev/null and b/docs/site/images/separator.jpg differ diff --git a/docs/site/images/title.png b/docs/site/images/title.png new file mode 100644 index 00000000..e257bf20 Binary files /dev/null and b/docs/site/images/title.png differ diff --git a/docs/site/images/user1.jpg b/docs/site/images/user1.jpg new file mode 100644 index 00000000..6373b77f Binary files /dev/null and b/docs/site/images/user1.jpg differ diff --git a/docs/site/index.html b/docs/site/index.html index cc1d0c4d..f4b25b06 100644 --- a/docs/site/index.html +++ b/docs/site/index.html @@ -1,97 +1,186 @@ - - - Green Unicorn - Welcome - - - -
- - -
-

Quick Start

-
-$ sudo easy_install virtualenv
-$ mkdir ~/environments/
-$ virtualenv ~/environments/tutorial/
-$ cd ~/environments/tutorial/
-$ ls
-bin  include  lib
-$ source bin/activate
-(tutorial) $ ./bin/easy_install gunicorn
-(tutorial) $ mkdir myapp
-(tutorial) $ cd myapp/
-(tutorial) $ vi myapp.py
-(tutorial) $ cat myapp.py
-
-def app(environ, start_response):
-    data = "Hello, World!\n"
-    start_response("200 OK", [
-        ("Content-Type", "text/plain"),
-        ("Content-Length", str(len(data)))
-    ])
-    return iter([data])
-
-(tutorial) $ ../bin/gunicorn -w 4 myapp:app
-2010-06-05 23:27:07 [16800] [INFO] Arbiter booted
-2010-06-05 23:27:07 [16800] [INFO] Listening at: http://127.0.0.1:8000
-2010-06-05 23:27:07 [16801] [INFO] Worker spawned (pid: 16801)
-2010-06-05 23:27:07 [16802] [INFO] Worker spawned (pid: 16802)
-2010-06-05 23:27:07 [16803] [INFO] Worker spawned (pid: 16803)
-2010-06-05 23:27:07 [16804] [INFO] Worker spawned (pid: 16804)
-
-
-
-

About

-

- Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's - a pre-fork worker model ported from Ruby's - Unicorn project. The - Gunicorn server is broadly compatible with various web frameworks, - simply implemented, light on server resources, and fairly speedy. -

-
-
-

Features

- -
-
-

Version 0.14.6 / 2012-07-26

- -
-
-