uWSGI 似乎正在丢失请求

uWSGI 似乎正在丢失请求

我在 uWSGI 日志中看到以下内容,具体来说...The work of process 43017 is done. Seeya!

[pid: 43017|app: 0|req: 103/114] 207.140.171.16 () {50 vars in 847 bytes} [Fri Oct 17 12:59:49 2014] POST /v1/us/notification => generated 320 bytes in 326 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
[pid: 43017|app: 0|req: 104/115] 207.140.171.16 () {50 vars in 847 bytes} [Fri Oct 17 12:59:53 2014] POST /v1/us/notification => generated 319 bytes in 409 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
[pid: 43017|app: 0|req: 105/116] 207.140.171.16 () {50 vars in 847 bytes} [Fri Oct 17 12:59:54 2014] POST /v1/us/notification => generated 318 bytes in 487 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
[pid: 43017|app: 0|req: 106/117] 207.140.171.16 () {50 vars in 847 bytes} [Fri Oct 17 12:59:55 2014] POST /v1/us/notification => generated 318 bytes in 746 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
[pid: 43017|app: 0|req: 107/118] 207.140.171.16 () {50 vars in 847 bytes} [Fri Oct 17 12:59:56 2014] POST /v1/us/notification => generated 319 bytes in 644 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
...The work of process 43017 is done. Seeya!
[pid: 43022|app: 0|req: 7/119] 207.140.171.16 () {50 vars in 846 bytes} [Fri Oct 17 12:59:57 2014] POST /v1/us/notification => generated 320 bytes in 445 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
worker 2 killed successfully (pid: 43017)
Respawned uWSGI worker 2 (new pid: 43158)
mapping worker 2 to CPUs: 1 0 1
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x20e99d0 pid: 43158 (default app)
[pid: 43018|app: 0|req: 1/120] 207.140.171.16 () {50 vars in 847 bytes} [Fri Oct 17 12:59:59 2014] POST /v1/us/notification => generated 320 bytes in 523 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
announcing my loyalty to the Emperor...

发生这种情况时,我似乎丢失了请求。我不知道该去哪里查看修复方法,或者这是否是导致请求丢失的原因。如果我可以添加其他内容,请告诉我。

我已经使用以下配置运行 uWSGI:

/etc/init/uwsgi.conf

description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [06]

respawn

exec uwsgi --emperor /etc/uwsgi/apps-enabled --uid root --gid root --logto /var/log/uwsgi/uwsgi.log

/etc/uwsgi/apps-enabled/app.ini

[uwsgi]
; define variables to use in this script
; process name for easy identification in top
project = agent
base_dir = /var/www/app/%(project)
chdir = %(base_dir)
plugins = python
virtualenv = %(base_dir)/env
uid = www-data
gid = www-data
procname = %(project)

; This value needs to be tuned
workers = 8
max-request = 4000
harakiri = 300
reload-mercy = 8
cpu-affinity = 3
limit-as = 1024
reload-on-as = 512
reload-on-rss = 192
no-orphans = True
master = True

; Create pid file for easier process management
pidfile = %(base_dir)/run/%(project).pid

; Specify your app here
wsgi-file = %(base_dir)/project/%(project)-wsgi.py
log-reopen = True
logto = %(base_dir)/logs/uwsgi.log
chmod-socket = 666
vacuum = True
enable-threads = True
lazy-apps = True

; unix socket
socket = /tmp/%(project)-server.sock
; Enable stats
stats = /tmp/%(project)-stats.sock

相关内容