mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Fix: Typos, tabs to spaces and default workers
This commit is contained in:
parent
cb2d9203ee
commit
7230d65e22
66
README.rst
66
README.rst
@ -1,9 +1,9 @@
|
|||||||
About
|
About
|
||||||
-----
|
-----
|
||||||
|
|
||||||
gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and nothing else.
|
gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and nothing else.
|
||||||
|
|
||||||
This is a port of Unicorn (http://unicorn.bogomips.org/) in Python. Meet us on `#gunicorn irc channel <http://webchat.freenode.net/?channels=gunicorn>`_ on `Freenode`_.
|
This is a port of Unicorn (http://unicorn.bogomips.org/) in Python. Meet us on `#gunicorn irc channel <http://webchat.freenode.net/?channels=gunicorn>`_ on `Freenode`_.
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
@ -14,7 +14,7 @@ Install from sources::
|
|||||||
|
|
||||||
Or from Pypi::
|
Or from Pypi::
|
||||||
|
|
||||||
$ easy_install -U gunicorn
|
$ easy_install -U gunicorn
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
@ -24,18 +24,18 @@ Usage
|
|||||||
$ gunicorn --help
|
$ gunicorn --help
|
||||||
Usage: gunicorn [OPTIONS] [APP_MODULE]
|
Usage: gunicorn [OPTIONS] [APP_MODULE]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-b BIND, --bind=BIND Adress to listen on. Ex. 127.0.0.1:8000 or
|
-b BIND, --bind=BIND Adress to listen on. Ex. 127.0.0.1:8000 or
|
||||||
unix:/tmp/gunicorn.sock
|
unix:/tmp/gunicorn.sock
|
||||||
--workers=WORKERS Number of workers to spawn. [none]
|
--workers=WORKERS Number of workers to spawn. [1]
|
||||||
-p PIDFILE, --pid=PIDFILE
|
-p PIDFILE, --pid=PIDFILE
|
||||||
set the background PID FILE
|
set the background PID FILE
|
||||||
-D, --daemon Run daemonized in the background.
|
-D, --daemon Run daemonized in the background.
|
||||||
--log-level=LOGLEVEL Log level below which to silence messages. [info]
|
--log-level=LOGLEVEL Log level below which to silence messages. [info]
|
||||||
--log-file=LOGFILE Log to a file. - is stdout. [-]
|
--log-file=LOGFILE Log to a file. - is stdout. [-]
|
||||||
-d, --debug Debug mode. only 1 worker.
|
-d, --debug Debug mode. only 1 worker.
|
||||||
--version show program's version number and exit
|
--version show program's version number and exit
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
|
|
||||||
|
|
||||||
Example with test app::
|
Example with test app::
|
||||||
@ -56,40 +56,40 @@ or use `run_gunicorn` command.
|
|||||||
|
|
||||||
add `gunicorn` to INSTALLED_APPS in the settings file::
|
add `gunicorn` to INSTALLED_APPS in the settings file::
|
||||||
|
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
...
|
...
|
||||||
"gunicorn",
|
"gunicorn",
|
||||||
)
|
)
|
||||||
|
|
||||||
Then run::
|
Then run::
|
||||||
|
|
||||||
python manage.py run_gunicorn
|
python manage.py run_gunicorn
|
||||||
|
|
||||||
Paste-compatible projects
|
Paste-compatible projects
|
||||||
+++++++++++++++++++++++++
|
+++++++++++++++++++++++++
|
||||||
|
|
||||||
For paste-compatible projects (like Pylons, TurboGears 2, ...) use the `gunicorn_paste` command::
|
For paste-compatible projects (like Pylons, TurboGears 2, ...) use the `gunicorn_paste` command::
|
||||||
|
|
||||||
$ cd your pasteproject
|
$ cd your pasteproject
|
||||||
$ gunicorn_paste --workers=2 development.ini
|
$ gunicorn_paste --workers=2 development.ini
|
||||||
|
|
||||||
or usual paster command::
|
or usual paster command::
|
||||||
|
|
||||||
$ cd your pasteproject
|
$ cd your pasteproject
|
||||||
$ paster serve development.ini workers=2
|
$ paster serve development.ini workers=2
|
||||||
|
|
||||||
In last case don't forget to add a server section for gunicorn. Here is an example that use
|
In last case don't forget to add a server section for gunicorn. Here is an example that use
|
||||||
gunicorn as main server::
|
gunicorn as main server::
|
||||||
|
|
||||||
[server:main]
|
[server:main]
|
||||||
use = egg:gunicorn#main
|
use = egg:gunicorn#main
|
||||||
host = 127.0.0.1
|
host = 127.0.0.1
|
||||||
port = 5000
|
port = 5000
|
||||||
|
|
||||||
Kernel Parameters
|
Kernel Parameters
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
There are various kernel parameters that you might want to tune in order to deal with a large number of simulataneous 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.
|
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.
|
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.
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ One of the first settings that usually needs to be bumped is the maximum number
|
|||||||
Increasing the Listen Queue Size
|
Increasing the Listen Queue Size
|
||||||
++++++++++++++++++++++++++++++++
|
++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
Listening sockets have an associated queue of incomming 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.
|
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.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ After a socket is closed it eventually enters the TIME_WAIT state. This can beco
|
|||||||
This setting is generally only required on machines that are being used to test a network server.
|
This setting is generally only required on machines that are being used to test a network server.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
$ sudo sysctl -w net.inet.ip.portrange.first="8048"
|
$ sudo sysctl -w net.inet.ip.portrange.first="8048"
|
||||||
|
|
||||||
Check `this article`_ for more information on ephemeral ports.
|
Check `this article`_ for more information on ephemeral ports.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user