我们在AWS免费等级 Ubuntu(14.04.5 LTS)上托管了我们的Web应用(Angular CLI:1.7.3,Node:9.5.0,Django 2.0.3) VM。我们使用ELB(弹性负载均衡器) Nginx-1.4.6 和 gunicorn-19.7.1
当我们尝试从浏览器访问我们的应用程序时,突然枪支内存使用量增加很高:
Normal:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
16248 ubuntu 20 0 313.1m 94.6m 9.3m R 15.6 9.5 0:00.71 gunicorn
While using App:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
16235 ubuntu 20 0 684.9m 315.8m 11.1m R 61.4 31.8 0:04.51 gunicorn
下面是我们的gunicorn配置(/etc/init/gunicorn.conf):
description "Gunicorn application server handling myproject"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
setuid ubuntu
setgid www-data
chdir /home/ubuntu/project/
#--max-requests INT : will restarted worker after those many requests which can
#overcome any memory leaks in code
exec ./env/bin/gunicorn --max-requests 1 --workers 3 --bind
unix:/home/ubuntu/project/django-ng.sock config.wsgi:application
我们已将 max-requests设置为1,将worker设置为3 。有人可以告诉我出了什么问题吗?