配置文件
#!/home/xx/.virtualenvs/xx/bin/python
# encoding: utf-8import multiprocessing# 监听端口
bind = '0.0.0.0:5000'
# 工作模式
worker_class = 'gevent'
# 并行工作进程数
workers = multiprocessing.cpu_count() * 1
# 设置守护进程
daemon = True# 设置日志记录水平
loglevel = 'debug'
# 设置错误信息日志路径
errorlog = './log/error.log'
# 设置访问日志路径
accesslog = './log/access.log'
启动程序
gunicorn -c xxx.conf
查看状态
pstree -ap|grep gunicorn