Gunicorn占用内存过多

服务器内存是512m

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
17029 yuwei 20 0 163m 145m 2352 S 0.0 28.9 4:34.79 gunicorn
17024 yuwei 20 0 163m 145m 2396 S 0.0 28.9 4:25.63 gunicorn
17023 yuwei 20 0 164m 144m 676 S 0.0 28.7 4:25.60 gunicorn

三条gunicorn进程占了这么多……

启动的命令是: ./venv/bin/gunicorn -D -c etc/gunicorn.conf app.gunicorn:application

$ cat gunicorn.conf

workers = multiprocessing.cpu_count() * 2 + 1
proc_name = 'lyric-generator'
pidfile = os.path.join(homedir, 'var/pid/gunicorn-lyric-generator.pid')
errorlog = os.path.join(homedir, 'var/log/gunicorn-lyric-generator.error.log')
loglevel = 'debug'

有朋友能指点一下么

14 comments