使用uwsgitop和套接字的uWSGI统计信息显示JSONDecodeError

时间:2018-09-27 11:26:07

标签: python django server uwsgi uwsgi-stats-server

我没有使用uwsgitop和socket获得uwsgi统计信息。我已经将uwsgi配置用于带有套接字的统计信息,当我尝试使用以下命令获取统计信息时:

uwsgitop /var/www/uwsgi/proj.socket

抛出错误

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

我正在使用uwsgi 版本2.0.17.1

这是我的uwsgi ini文件

[uwsgi]

# Multi Thread Support
enable-threads = true

# Django-related settings
# the base directory (full path)
chdir           = /home/user/base-dir/proj-path/
# Django's wsgi file
module          = proj.wsgi
# the virtualenv (full path)
home            = /home/user/base-path/

# process-related settings
# master
master          = true
# maximum number of worker processes
processes       = 10

socket = /var/www/uwsgi/proj.socket
# ... with appropriate permissions - may be needed
chmod-socket    = 666
# clear environment on exit
vacuum          = true
daemonize = /var/www/uwsgi/uwsgi.log
pidfile = /var/www/uwsgi/uwsgi_hub.pid
logto = /var/log/proj_uwsgi%n.log
uid = user
gid = user
http-auto-gzip = true

memory-report = True

py-tracebacker=/var/www/uwsgi/proj.socket

--stats /var/www/uwsgi/proj.socket

1 个答案:

答案 0 :(得分:1)

我认为您的配置文件中应该包含以下内容:

 socket = /var/www/uwsgi/proj.socket
stats = /var/www/uwsgi/stats.socket

然后在stats套接字上运行uwsgitop,如下所示:

uwsgitop /var/www/uwsgi/stats.socket