.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "GUNICORN_PASTER 1" .TH GUNICORN_PASTER 1 "2017-10-29" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" gunicorn_paster \- Event\-based HTTP/WSGI server, Paste application entry\-point .SH "SYNOPSIS" .IX Header "SYNOPSIS" gunicorn_paster [\s-1OPTIONS\s0] [\s-1SETTINGS_PATH\s0] .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-c\fR \fI\s-1CONFIG\s0\fR, \fB\-\-config\fR=\fI\s-1CONFIG\s0\fR" 2 .IX Item "-c CONFIG, --config=CONFIG" Config file. [none] .IP "\fB\-b\fR \fI\s-1BIND\s0\fR, \fB\-\-bind\fR=\fI\s-1BIND\s0\fR" 2 .IX Item "-b BIND, --bind=BIND" Address to listen on. Ex. 127.0.0.1:8000 or unix:/tmp/gunicorn.sock .IP "\fB\-w\fR \fI\s-1WORKERS\s0\fR, \fB\-\-workers\fR=\fI\s-1WORKERS\s0\fR" 2 .IX Item "-w WORKERS, --workers=WORKERS" Number of workers to spawn. [1] .IP "\fB\-a\fR \fI\s-1ARBITER\s0\fR, \fB\-\-arbiter\fR=\fI\s-1ARBITER\s0\fR" 2 .IX Item "-a ARBITER, --arbiter=ARBITER" gunicorn arbiter entry point or module [egg:gunicorn#main] .IP "\fB\-p\fR \fI\s-1PIDFILE\s0\fR, \fB\-\-pid\fR=\fI\s-1PIDFILE\s0\fR" 2 .IX Item "-p PIDFILE, --pid=PIDFILE" Set the background \s-1PID FILE\s0 .IP "\fB\-D\fR, \fB\-\-daemon\fR" 2 .IX Item "-D, --daemon" Run daemonized in the background. .IP "\fB\-m\fR \fI\s-1UMASK\s0\fR, \fB\-\-umask\fR=\fI\s-1UMASK\s0\fR" 2 .IX Item "-m UMASK, --umask=UMASK" Define umask of daemon process .IP "\fB\-u\fR \fI\s-1USER\s0\fR, \fB\-\-user\fR=\fI\s-1USER\s0\fR" 2 .IX Item "-u USER, --user=USER" Change worker user .IP "\fB\-g\fR \fI\s-1GROUP\s0\fR, \fB\-\-group\fR=\fI\s-1GROUP\s0\fR" 2 .IX Item "-g GROUP, --group=GROUP" Change worker group .IP "\fB\-n\fR \fI\s-1PROC_NAME\s0\fR, \fB\-\-name\fR=\fI\s-1PROC_NAME\s0\fR" 2 .IX Item "-n PROC_NAME, --name=PROC_NAME" Process name .IP "\fB\-\-log\-level\fR=\fI\s-1LOGLEVEL\s0\fR" 2 .IX Item "--log-level=LOGLEVEL" Log level below which to silence messages. [info] .IP "\fB\-\-log\-file\fR=\fI\s-1LOGFILE\s0\fR" 2 .IX Item "--log-file=LOGFILE" Log to a file. \- equals stdout. [\-] .IP "\fBd\fR, \fB\-\-debug\fR" 2 .IX Item "d, --debug" Debug mode. only 1 worker. .IP "\fB\-\-version\fR" 2 .IX Item "--version" Show program's version number and exit .IP "\fB\-h\fR, \fB\-\-help\fR" 2 .IX Item "-h, --help" show this help message and exit .SH "DESCRIPTION" .IX Header "DESCRIPTION" Green Unicorn (gunicorn) is an \s-1HTTP/WSGI\s0 server designed to serve fast clients or sleepy applications. That is to say; behind a buffering front-end server such as nginx or lighttpd. .PP .Vb 10 \& * 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 .Ve .SH "TUNING" .IX Header "TUNING" .SS "\s-1KERNEL PARAMETERS\s0" .IX Subsection "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. .PP The commands listed are tested under Mac \s-1OS X 10.6.\s0 Your flavor of Unix may use slightly different flags. Always reference the appropriate man pages if uncertain. .SS "\s-1INCREASING THE FILE DESCRIPTOR LIMIT\s0" .IX Subsection "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. .PP .Vb 1 \& $ sudo ulimit \-n 1024 .Ve .SS "\s-1INCREASING THE LISTEN QUEUE SIZE\s0" .IX Subsection "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. .PP .Vb 1 \& $ sudo sysctl \-w kern.ipc.somaxconn="1024" .Ve .SS "\s-1WIDENING THE EPHEMERAL PORT RANGE\s0" .IX Subsection "WIDENING THE EPHEMERAL PORT RANGE" After a socket is closed it eventually enters the \s-1TIME_WAIT\s0 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. .PP This setting is generally only required on machines that are being used to test a network server. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIgunicorn\fR\|(1)