配置文件
#!/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