UWSGI关于内存释放问题

#!/bin/bash

ps -ef|grep -P "project\.pid" |awk '{print $2}'|xargs kill -9


ulimit -n 20000


/usr/local/env/project/bin/uwsgi -s 127.0.0.1:7001 -M -R 200 -p 4 --evil-reload-on-as 100 --evil-reload-on-rss 100 --virtualenv "/usr/local/python-env/project" --env "DJANGO_SETTINGS_MODULE=settings" --wsgi "django.core.handlers.wsgi:WSGIHandler()" --daemonize "/var/log/project/uwsgi.log" --pidfile "/var/run/project.pid" --touch-reload "/var/run/project.pid"


问题:实际应用过程中发现UWSGI没有主动释放内存,导致内存不断增大。

办法:

--evil-reload-on-as 100 --evil-reload-on-rss 100

虚拟内存或者实际内存大于100M,UWSGI主进程将重启子进程


UWSGI配置说明:

http://uwsgi-docs.readthedocs.org/en/latest/Options.html

中文翻译:


没有更多推荐了,返回首页