用于日志记录应用程序的uwsgi设置

时间:2018-06-27 09:34:40

标签: python django django-rest-framework uwsgi

我正在使用rest api(在Django rest中)将数据记录到Elasticsearch。它仅接收一堆数据(每秒)并将其记录到Elasticsearch(使用elasticsearch_dsl)。我在生产中使用uwsgi。我想问一下我的初始化文件是否正常:

[uwsgi]
project = project
plugin = python3

chdir           = /app
module          = project.wsgi
home             = /home/project/env

# process-related settings
master          = true
# maximum number of worker processes
processes       = 3
http-socket          = 0.0.0.0:8000
# clear environment on exit
vacuum          = true

max-requests = 250
die-on-term = true
# kills stucked process
harakiri=30
single-interpreter=True
enable-threads=True

它工作正常,但有时一些工人被杀死:

DAMN ! worker 2 (pid: 21) died, killed by signal 9 :( trying respawn ...

,有时还包括:

Wed Jun 27 09:09:02 2018 - *** HARAKIRI ON WORKER 2 (pid: 17, try: 1) ***
Wed Jun 27 09:09:02 2018 - HARAKIRI !!! worker 2 status !!!

只想问一些改进我的init文件的建议。或如何调试这种情况。

0 个答案:

没有答案