Python 处理请求的uwsgi

Python 处理请求的uwsgi,python,flask,uwsgi,Python,Flask,Uwsgi,我有一个非常基本的烧瓶应用在uwsgi下,由信号管理在监督或TL。我用更便宜的价格来衡量工人,遇到了非常令人不安的情况。 uwsgi正在杀死最老的工人,即使是在处理请求时,也会造成500人死亡 如何防止uwsgi为了降低成本而杀害处理请求的员工? 非常感谢任何帮助/提示。 发现另一个类似的帖子,但没有回复: 配置:uwsgi版本:2.0.4 # Auto-scaling workers = 30 cheaper = 2 cheaper-step = 3 cheaper-algo = backlo

我有一个非常基本的烧瓶应用在uwsgi下,由信号管理在监督或TL。我用更便宜的价格来衡量工人,遇到了非常令人不安的情况。 uwsgi正在杀死最老的工人,即使是在处理请求时,也会造成500人死亡

如何防止uwsgi为了降低成本而杀害处理请求的员工?

非常感谢任何帮助/提示。 发现另一个类似的帖子,但没有回复:

配置:uwsgi版本:2.0.4

# Auto-scaling
workers = 30
cheaper = 2
cheaper-step = 3
cheaper-algo = backlog
cheaper-overload = 2
日志:

[pid:15601 | app:0 | req:13/78]10.83.9.61(){368字节中有28个变量}[Fri Sep 30 02:00:34 2016]POST/xxxxxxxxxxxxxxx=>在151毫秒内生成257个字节(HTTP/1.1200)在72字节内生成2个报头(核心0上有1个开关)
[pid:15601 | app:0 | req:14/79]10.83.9.61(){368字节中的28个变量}[Fri Sep 30 02:00:35 2016]POST/xxxxxxxxxxxxxx=>在649毫秒内生成186个字节(HTTP/1.1200)在72字节内生成2个报头(核心0上的1个开关)
[pid:15600 | app:0 | req:21/80]10.83.9.62(){28vars in 369 bytes}[Fri Sep 30 03:30:08 2016]POST/xxxxxxxxxxxxxxx=>在2696毫秒内生成186字节(HTTP/1.1200)在72字节内生成2个报头(核心0上的3个开关)
新生的uWSGI工人1(新pid:21009)
新生的uWSGI工人4(新pid:21010)
新生的uWSGI工人5(新pid:21011)
[pid:15601 | app:0 | req:15/81]10.83.9.62(){370字节中的28个变量}[Fri Sep 30 03:30:09 2016]POST/xxxxxxxxxxxxxxx=>在3046毫秒内生成186字节(HTTP/1.1200)在72字节内生成2个报头(核心0上的两个开关)
[pid:15600 | app:0 | req:22/82]10.83.9.63(){370字节中的28个变量}[Fri Sep 30 03:30:10 2016]POST/xxxxxxxxxxxxxxx=>在3347毫秒内生成0个字节(HTTP/1.1500)在127字节内生成2个报头(核心0上的7个开关)
已成功终止工作进程2(pid:15600)在2560毫秒内生成0字节(HTTP/1.1500)在127字节内生成2个标头(核心0上有3个开关)
[pid:21010 | app:0 | req:19/84]10.83.9.63(){28vars in 369 bytes}[Fri Sep 30 03:30:12 2016]POST/xxxxxxxxxxxxxxx=>在2931毫秒内生成186个字节(HTTP/1.1200)在72个字节内生成2个报头(核心0上的4个开关)
已成功终止工作进程3(pid:15601)在3236毫秒内生成186字节(HTTP/1.1200)在72字节内生成2个头(核心0上的4个开关)
[pid:21009 | app:0 | req:7/86]10.83.9.61(){370字节中的28个变量}[Fri Sep 30 03:30:12 2016]POST/xxxxxxxxxxxxxxx=>在3532毫秒内生成0字节(HTTP/1.1500)在127字节内生成2个报头(核心0上的4个开关)
已成功终止工作进程1(pid:21009)在1614毫秒内生成186个字节(HTTP/1.1200)在72个字节内生成2个标头(核心0上有1个交换机)
更新的uWSGI工人1(新pid:21013)
新生uWSGI工人2(新pid:21014)
新生的uWSGI工人3(新pid:21015)
[pid:21011 | app:0 | req:24/88]10.83.9.61(){28vars in 369 bytes}[Fri Sep 30 03:30:17 2016]POST/xxxxxxxxxxxxxxx=>在2546毫秒内生成186字节(HTTP/1.1200)在72字节内生成2个报头(核心0上的3个开关)
[pid:21010 | app:0 | req:20/89]10.83.9.62(){370字节中的28个变量}[Fri Sep 30 03:30:15 2016]POST/xxxxxxxxxxxxxx=>在4845毫秒内生成0字节(HTTP/1.1500)在127字节内生成2个报头(核心0上的6个开关)
worker 4成功终止(pid:21010)在2402毫秒内生成186字节(HTTP/1.1 200)在72字节内生成2个标头(核心0上的3个开关)

工人5成功杀死(pid:21011)缺陷于2016年8月修复并合并


缺陷已于2016年8月修复并合并

[pid: 15601|app: 0|req: 13/78] 10.83.9.61 () {28 vars in 368 bytes} [Fri Sep 30 02:00:34 2016] POST /xxxxxxxxxxxx => generated 257 bytes in 151 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
[pid: 15601|app: 0|req: 14/79] 10.83.9.61 () {28 vars in 368 bytes} [Fri Sep 30 02:00:35 2016] POST /xxxxxxxxxxxx => generated 186 bytes in 649 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
[pid: 15600|app: 0|req: 21/80] 10.83.9.62 () {28 vars in 369 bytes} [Fri Sep 30 03:30:08 2016] POST /xxxxxxxxxxxx => generated 186 bytes in 2696 msecs (HTTP/1.1 200) 2 headers in 72 bytes (3 switches on core 0)
Respawned uWSGI worker 1 (new pid: 21009)
Respawned uWSGI worker 4 (new pid: 21010)
Respawned uWSGI worker 5 (new pid: 21011)
[pid: 15601|app: 0|req: 15/81] 10.83.9.62 () {28 vars in 370 bytes} [Fri Sep 30 03:30:09 2016] POST /xxxxxxxxxxxx => generated 186 bytes in 3046 msecs (HTTP/1.1 200) 2 headers in 72 bytes (2 switches on core 0)
[pid: 15600|app: 0|req: 22/82] 10.83.9.63 () {28 vars in 370 bytes} [Fri Sep 30 03:30:10 2016] POST /xxxxxxxxxxxx => generated 0 bytes in 3347 msecs (HTTP/1.1 500) 2 headers in 127 bytes (7 switches on core 0)
worker 2 killed successfully (pid: 15600)       <------------- pid 15600 was interrupted, returned 500 (line above)
uWSGI worker 2 cheaped.
[pid: 15601|app: 0|req: 16/83] 10.83.9.62 () {28 vars in 369 bytes} [Fri Sep 30 03:30:12 2016] POST /xxxxxxxxxxxx => generated 0 bytes in 2560 msecs (HTTP/1.1 500) 2 headers in 127 bytes (3 switches on core 0)
[pid: 21010|app: 0|req: 19/84] 10.83.9.63 () {28 vars in 369 bytes} [Fri Sep 30 03:30:12 2016] POST /xxxxxxxxxxxx => generated 186 bytes in 2931 msecs (HTTP/1.1 200) 2 headers in 72 bytes (4 switches on core 0)
worker 3 killed successfully (pid: 15601)       <------------- pid 15601 was interrupted, returned 500 (line above)
uWSGI worker 3 cheaped.
[pid: 21011|app: 0|req: 22/85] 10.83.9.61 () {28 vars in 370 bytes} [Fri Sep 30 03:30:12 2016] POST /xxxxxxxxxxxx => generated 186 bytes in 3236 msecs (HTTP/1.1 200) 2 headers in 72 bytes (4 switches on core 0)
[pid: 21009|app: 0|req: 7/86] 10.83.9.61 () {28 vars in 370 bytes} [Fri Sep 30 03:30:12 2016] POST /xxxxxxxxxxxx => generated 0 bytes in 3532 msecs (HTTP/1.1 500) 2 headers in 127 bytes (4 switches on core 0)
worker 1 killed successfully (pid: 21009)       <------------- pid 15601 was interrupted, returned 500 (line above)
uWSGI worker 1 cheaped.
[pid: 21011|app: 0|req: 23/87] 10.83.9.63 () {28 vars in 369 bytes} [Fri Sep 30 03:30:15 2016] POST /xxxxxxxxxxxx => generated 186 bytes in 1614 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
Respawned uWSGI worker 1 (new pid: 21013)
Respawned uWSGI worker 2 (new pid: 21014)
Respawned uWSGI worker 3 (new pid: 21015)
[pid: 21011|app: 0|req: 24/88] 10.83.9.61 () {28 vars in 369 bytes} [Fri Sep 30 03:30:17 2016] POST /xxxxxxxxxxxx => generated 186 bytes in 2546 msecs (HTTP/1.1 200) 2 headers in 72 bytes (3 switches on core 0)
[pid: 21010|app: 0|req: 20/89] 10.83.9.62 () {28 vars in 370 bytes} [Fri Sep 30 03:30:15 2016] POST /xxxxxxxxxxxx => generated 0 bytes in 4845 msecs (HTTP/1.1 500) 2 headers in 127 bytes (6 switches on core 0)
worker 4 killed successfully (pid: 21010)       <------------- pid 15601 was interrupted, returned 500 (line above)
uWSGI worker 4 cheaped.
[pid: 21015|app: 0|req: 17/90] 10.83.9.61 () {28 vars in 369 bytes} [Fri Sep 30 03:30:18 2016] POST /xxxxxxxxxxxx => generated 186 bytes in 2402 msecs (HTTP/1.1 200) 2 headers in 72 bytes (3 switches on core 0)
worker 5 killed successfully (pid: 21011)       <------------- pid 15601 was interrupted, returned 500 (line above)