1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
|
=encoding utf8
=head1 NAME
gunicorn_paster - Event-based HTTP/WSGI server, Paste application entry-point
=head1 SYNOPSIS
gunicorn_paster [OPTIONS] [SETTINGS_PATH]
=head1 OPTIONS
=over 2
=item B<-c> I<CONFIG>, B<--config>=I<CONFIG>
Config file. [none]
=item B<-b> I<BIND>, B<--bind>=I<BIND>
Address to listen on. Ex. 127.0.0.1:8000 or unix:/tmp/gunicorn.sock
=item B<-w> I<WORKERS>, B<--workers>=I<WORKERS>
Number of workers to spawn. [1]
=item B<-a> I<ARBITER>, B<--arbiter>=I<ARBITER>
gunicorn arbiter entry point or module [egg:gunicorn#main]
=item B<-p> I<PIDFILE>, B<--pid>=I<PIDFILE>
Set the background PID FILE
=item B<-D>, B<--daemon>
Run daemonized in the background.
=item B<-m> I<UMASK>, B<--umask>=I<UMASK>
Define umask of daemon process
=item B<-u> I<USER>, B<--user>=I<USER>
Change worker user
=item B<-g> I<GROUP>, B<--group>=I<GROUP>
Change worker group
=item B<-n> I<PROC_NAME>, B<--name>=I<PROC_NAME>
Process name
=item B<--log-level>=I<LOGLEVEL>
Log level below which to silence messages. [info]
=item B<--log-file>=I<LOGFILE>
Log to a file. - equals stdout. [-]
=item B<d>, B<--debug>
Debug mode. only 1 worker.
=item B<--version>
Show program's version number and exit
=item B<-h>, B<--help>
show this help message and exit
=back
=head1 DESCRIPTION
Green Unicorn (gunicorn) is an HTTP/WSGI server designed to serve fast clients
or sleepy applications. That is to say; behind a buffering front-end server
such as nginx or lighttpd.
* Optional support for Eventlet and Gevent to provide asynchronous
long-polling ("Comet") connections.
* Process management: Gunicorn reaps and restarts workers that die.
* Easy integration with Django and Paster compatible applications (Pylons,
TurboGears 2, etc.
* Load balancing via pre-fork and a shared socket
* Graceful worker process restarts
* Upgrading without losing connections
* Decode chunked transfers on-the-fly, allowing upload progress notifications
or stream-based protocols over HTTP
=head1 TUNING
=head2 KERNEL PARAMETERS
There are various kernel parameters that you might want to tune in order to
deal with a large number of simultaneous connections. Generally these should
only affect sites with a large number of concurrent requests and apply to any
sort of network server you may be running. They're listed here for ease of
reference.
The commands listed are tested under Mac OS X 10.6. Your flavor of Unix may use
slightly different flags. Always reference the appropriate man pages if
uncertain.
=head2 INCREASING THE FILE DESCRIPTOR LIMIT
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 1024
=head2 INCREASING THE LISTEN QUEUE SIZE
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 kern.ipc.somaxconn="1024"
=head2 WIDENING THE EPHEMERAL PORT RANGE
After a socket is closed it eventually enters the TIME_WAIT state. This can
become an issue after a prolonged burst of client activity. Eventually the
ephemeral port range is used up which can cause new connections to stall while
they wait for a valid port.
This setting is generally only required on machines that are being used to test
a network server.
=head1 SEE ALSO
L<gunicorn(1)>
|