【问题标题】:emperor.uwsgi (nginx, uwsgi and web2py) takes a very long time to restartEmperor.uwsgi(nginx、uwsgi 和 web2py)需要很长时间才能重新启动
【发布时间】:2020-11-10 00:25:12
【问题描述】:

我目前使用 Nginx/UWSGI/Web2py 来运行 Web 应用程序。

当我运行一个新的部署 systemctl restart Emperor.uwsgi 时,该操作几乎需要一分钟才能完成。我该如何解决?

我的ini文件是:

[uwsgi]

socket = /tmp/web2py2.socket
pythonpath = /home/www-data/2/web2py/
mount = /=wsgihandler:application
processes = 2
master = true
harakiri = 300
reload-mercy = 8
cpu-affinity = 1
stats = /tmp/stats2.socket
max-requests = 2000
limit-as = 512
reload-on-as = 256
reload-on-rss = 192
uid = www-data
gid = www-data
touch-reload = /home/www-data/2/web2py/routes.py
no-orphans = true
logto = /var/log/uwsgi/web2py2.log
vacuum = true
die-on-term = true
plugins-dir = /usr/local/lib/uwsgi
plugin = python27

我的服务文件是:

[Unit]
Description=uWSGI Emperor
After=syslog.target

[Service]
ExecStart=/usr/local/bin/uwsgi --ini /etc/uwsgi/web2py2.ini
# Requires systemd version 211 or newer
RuntimeDirectory=uwsgi
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all

[Install]
WantedBy=multi-user.target

【问题讨论】:

  • 当前重启时间为 1m 30s。

标签: linux ubuntu nginx uwsgi web2py


【解决方案1】:

问题与选项有关:

die-on-term = true

我不知道为什么,但是当我关闭时,它可以工作文件,少于 2 秒。

【讨论】:

    猜你喜欢
    • 2013-11-15
    • 2014-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多