Gunicorn
Gunicorn(绿色独角兽)是一个Python WSGI的HTTP服务器。从Ruby的独角兽(Unicorn )项目移植。该Gunicorn服务器与各种Web框架兼容,实现非常简单,轻量级的资源消耗。Gunicorn直接用命令启动,不需要编写配置文件,相对uWSGI要容易很多。
安装gunicorn
pip install gunicorn
查看命令行选项: 安装gunicorn成功后,通过命令行的方式可以查看gunicorn的使用信息。
gunicorn -h
usage: gunicorn [OPTIONS] [APP_MODULE]
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
--access-logfile FILE
The Access log file to write to. [None]
--log-level LEVEL The granularity of Error log outputs. [info]
--capture-output Redirect stdout/stderr to specified file in
:ref:`errorlog`. [False]
--log-config FILE The log config file to use. [None]
--log-syslog-to SYSLOG_ADDR
Address to send syslog messages. [udp://localhost:514]
--log-syslog-facility SYSLOG_FACILITY
Syslog facility name [user]
--access-logformat STRING
The access log format. [%(h)s %(l)s %(u)s %(t)s
"%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"]
--cert-reqs CERT_REQS
Whether client certificate is required (see stdlib ssl
module's) [0]
--check-config Check the configuration. [False]
--limit-request-line INT
The maximum size of HTTP request line in bytes. [4094]
-k STRING, --worker-class STRING
The type of workers to use. [sync]
--error-logfile FILE, --log-file FILE
The Error log file to write to. [-]
--spew Install a trace function that spews every line
executed by the server. [False]
--certfile FILE SSL certificate file [None]
--paste-gl