Skip to content

Commit

Permalink
gunicorn
Browse files Browse the repository at this point in the history
  • Loading branch information
wuranxu committed Aug 25, 2021
1 parent 7149e8a commit af938b0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
22 changes: 22 additions & 0 deletions gunicorn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# gunicorn的配置
import os
import gevent.monkey

gevent.monkey.patch_all()

import multiprocessing

# debug = True
loglevel = 'debug'
bind = "0.0.0.0:4000"
pidfile = "logs/gunicorn.pid"
accesslog = "logs/access.log"
errorlog = "logs/debug.log"
daemon = True
timeout = 60

# 启动的进程数
# workers = multiprocessing.cpu_count()
workers = 8
worker_class = 'gevent'
x_forwarded_for_header = 'X-FORWARDED-FOR'
9 changes: 9 additions & 0 deletions supervisor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[program: pity]
command=/usr/local/bin/gunicorn --config=gunicorn.py run:pity
directory=/home/tester/workspace/pity
startsecs=0
stopwaitsecs=0
autostart=false
autorestart=true
stdout_logfile=/home/tester/workspace/pity/logs/gunicorn.log
stderr_logfile=/home/tester/workspace/pity/logs/gunicorn.err

0 comments on commit af938b0

Please sign in to comment.