Sync settings docs with gunicorn/config.py

This commit is contained in:
Berker Peksag 2016-12-22 22:02:44 +03:00
parent 712a502d62
commit 4933aedede

View File

@ -82,7 +82,7 @@ You'll want to vary this a bit to find the best for your particular
application's work load. application's work load.
By default, the value of the ``WEB_CONCURRENCY`` environment variable. By default, the value of the ``WEB_CONCURRENCY`` environment variable.
If it is not defined, the default is 1. If it is not defined, the default is ``1``.
worker_class worker_class
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -172,9 +172,7 @@ timeout
* ``-t INT, --timeout INT`` * ``-t INT, --timeout INT``
* ``30`` * ``30``
A worker must notify the master process once per timeout interval. Workers silent for more than this many seconds are killed and restarted.
If it fails do so, the worker is killed and a new worker is spawned
to replace it.
Generally set to thirty seconds. Only set this noticeably higher if Generally set to thirty seconds. Only set this noticeably higher if
you're sure of the repercussions for sync workers. For the non sync you're sure of the repercussions for sync workers. For the non sync
@ -246,8 +244,12 @@ limit_request_field_size
Limit the allowed size of an HTTP request header field. Limit the allowed size of an HTTP request header field.
Value is a number from 0 (unlimited) to 8190. to set the limit Value is a positive number or 0. Setting it to 0 will allow unlimited
on the allowed size of an HTTP request header field. header field sizes.
.. warning::
Setting this parameter to a very high or unlimited value can open
up for DDOS attacks.
Debugging Debugging
--------- ---------
@ -314,14 +316,19 @@ sendfile
~~~~~~~~ ~~~~~~~~
* ``--no-sendfile`` * ``--no-sendfile``
* ``True`` * ``None``
Disables the use of ``sendfile()``. Disables the use of ``sendfile()``.
If not set, the value of the ``SENDFILE`` environment variable is used
to enable or disable its usage.
.. versionadded:: 19.2 .. versionadded:: 19.2
.. versionchanged:: 19.4 .. versionchanged:: 19.4
Swapped ``--sendfile`` with ``--no-sendfile`` to actually allow Swapped ``--sendfile`` with ``--no-sendfile`` to actually allow
disabling. disabling.
.. versionchanged:: 19.6
added support for the ``SENDFILE`` environment variable
chdir chdir
~~~~~ ~~~~~
@ -465,7 +472,10 @@ Front-end's IPs from which allowed to handle set secure headers.
Set to ``*`` to disable checking of Front-end IPs (useful for setups Set to ``*`` to disable checking of Front-end IPs (useful for setups
where you don't know in advance the IP address of Front-end, but where you don't know in advance the IP address of Front-end, but
you still trust the environment) you still trust the environment).
By default, the value of the ``FORWARDED_ALLOW_IPS`` environment
variable. If it is not defined, the default is ``"127.0.0.1"``.
Logging Logging
------- -------
@ -488,30 +498,31 @@ access_log_format
The access log format. The access log format.
========== =========== =========== ===========
Identifier Description Identifier Description
========== =========== =========== ===========
h remote address h remote address
l ``'-'`` l ``'-'``
u user name u user name
t date of the request t date of the request
r status line (e.g. ``GET / HTTP/1.1``) r status line (e.g. ``GET / HTTP/1.1``)
m request method m request method
U URL path without query string U URL path without query string
q query string q query string
H protocol H protocol
s status s status
B response length B response length
b response length or ``'-'`` (CLF format) b response length or ``'-'`` (CLF format)
f referer f referer
a user agent a user agent
T request time in seconds T request time in seconds
D request time in microseconds D request time in microseconds
L request time in decimal seconds L request time in decimal seconds
p process ID p process ID
{Header}i request header {Header}i request header
{Header}o response header {Header}o response header
========== =========== {Variable}e environment variable
=========== ===========
errorlog errorlog
~~~~~~~~ ~~~~~~~~
@ -521,7 +532,7 @@ errorlog
The Error log file to write to. The Error log file to write to.
``'-'`` means log to stderr. Using ``'-'`` for FILE makes gunicorn log to stderr.
.. versionchanged:: 19.2 .. versionchanged:: 19.2
Log to stderr by default. Log to stderr by default.
@ -553,10 +564,6 @@ The logger you want to use to log events in Gunicorn.
The default class (``gunicorn.glogging.Logger``) handle most of The default class (``gunicorn.glogging.Logger``) handle most of
normal usages in logging. It provides error and access logging. normal usages in logging. It provides error and access logging.
If you enable statsd support, then a special subclass
(``gunicorn.instrument.statsd.Statsd``) is used instead, which handles
sending the metrics to *statsd_host*
You can provide your own worker by giving Gunicorn a You can provide your own worker by giving Gunicorn a
Python path to a subclass like ``gunicorn.glogging.Logger``. Python path to a subclass like ``gunicorn.glogging.Logger``.
Alternatively the syntax can also load the Logger class Alternatively the syntax can also load the Logger class
@ -621,7 +628,7 @@ enable_stdio_inheritance
* ``-R, --enable-stdio-inheritance`` * ``-R, --enable-stdio-inheritance``
* ``False`` * ``False``
Enable stdio inheritance Enable stdio inheritance.
Enable inheritance for stdio file descriptors in daemon mode. Enable inheritance for stdio file descriptors in daemon mode.
@ -636,12 +643,6 @@ statsd_host
``host:port`` of the statsd server to log to. ``host:port`` of the statsd server to log to.
Note: enabling this switches the default *logger_class* to
``gunicorn.instrument.statsd.Statsd``. If you wish to use statsd with
a custom *logger_class*, you should make sure your class is API
compatible with ``gunicorn.instrument.statsd.Statsd``, or inherit from
it.
.. versionadded:: 19.1 .. versionadded:: 19.1
statsd_prefix statsd_prefix
@ -875,7 +876,7 @@ worker_exit
def worker_exit(server, worker): def worker_exit(server, worker):
pass pass
Called in the worker, right before it terminates. Called just after a worker has been exited.
The callable needs to accept two instance variables for the Arbiter and The callable needs to accept two instance variables for the Arbiter and
the just-exited Worker. the just-exited Worker.