- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 uwsgi 下有一个非常基本的 Flask 应用程序,由supervisorctl 下的信号管理。我使用更便宜的方法来扩展 worker ,并遇到了非常令人不安的情况。uwsgi 正在杀死最旧的工作人员,即使它正在处理请求,导致 500。
如何防止uwsgi为了便宜而杀死处理请求的 worker ?
非常感谢任何帮助/提示。发现另一个类似的帖子没有回复:UWSGI killing workers too fast
配置: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 () {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)
最佳答案
2016 年 8 月修复并合并了错误。
https://github.com/unbit/uwsgi/issues/1288
https://github.com/unbit/uwsgi/commit/f5dd0b855d0d21be62534dc98375fae2cd7c13f0
关于python - uwsgi 更便宜地杀死处理请求的 worker ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39801326/
uWSGI 主进程有什么用? 和/或我可以在哪里阅读更多相关信息? 我找到了零文档。 最佳答案 您可以找到有关大师的一些信息here和 here 一般来说,主文件负责优雅地重新加载您的应用程序服务器(
我有多个基于 Flask 的 web 应用程序在 docker 容器中运行(它们的进程需要与主机操作系统隔离)。为了运行这些应用程序,我在容器内使用了 uWSGI 服务器。传入的请求应该通过订阅服务器
我正在尝试使用 uwsgi 进行一些非常复杂的配置。从长远来看,我试图让自己的事情变得更容易,自然而然,这样做,我正在使事情变得尽可能困难。 无论如何,我正在寻找魔法变量的完整列表。我能在 Emper
我开始使用 uWSGI,我想知道它的工作人员是否是非阻塞/基于事件的(就像 nginx 一样)。 假设我已经像这样启动了 uWSGI: uwsgi --http :8000 --wsgi-file t
我们的应用程序是为 Python 2.7 编写的。它有一个配置为使用 Python 2.7 的 virtualenv。系统安装的 uWSGI 是用 Python 2.6 构建的。 It seems t
我在这个页面 http://uwsgi-docs.readthedocs.org/en/latest/StatsServer.html并使用 uwsgitop但我不知道如何解释输出。文档也没有透露太多
我看到这里发布了许多 uWSGI 配置,我在工作中遇到的现有应用程序的配置也有填充了 100 到 1000 值的 max-requests。 在一定数量的请求后回收进程的目的是什么?您是否试图避免内存
我正在使用 uWSGI 运行一个 webpy 网络服务器,有些请求花费的时间太长。设置 harakiri 模式后,我注意到请求被终止后会再次重试。 是否可以禁用此行为? 运行命令为: /usr/loc
uwsgi 中的“mule farm”是什么,它有什么用?有一些使用示例吗?我没有在文档或其他任何地方找到任何东西。 最佳答案 一群有名字的骡子 --farm chickens:1,2,3. --fa
在学习Python web开发时候,可能会遇到诸如uwsgi,wsgi等名词,下面通过梳理总结探究它们之间的关系。 CGI CGI,(Common Gateway Interface)通用网关接口,是
我已经使用 uWSGI 部署了一个 WSGI 应用程序,但是 I am not using NGINX .如何使用 uWSGI's internal routing将 http 请求重定向到 http
我正在使用命令在 uWsgi 服务器中测试应用程序, uwsgi --http :9090 --wsgi-file myapp.py --callable app --processes 4 --th
我们有一个工作的 uwsgi 服务器,带有一些 RPC 调用(注意:我们能够使用 uwsgi.rpc 与进程对话,因此它们端的设置很好)。我们发现我们有一些进程没有在 uwsgi 下运行,但我们想要与
我正在尝试为我的 Django 项目设置 uwsgi。它运行良好 ./manage.py runserver 0.0.0.0:9010 但是当我尝试 uwsgi --http :9010 --chd
我是 Linux 开发的新手。我对阅读的文档有点困惑。我的最终目标是托管一个简单的 python 支持的 Web 服务,该服务将检查传入的有效负载,并将其转发到其他服务器。这应该不到 30 行 pyt
我的 Django 应用程序倾向于使用 uwsgi+nginx,谁能分享启动我的 uwsgi 进程的最佳方法?有没有人有调整uwsgi的经验? 最佳答案 在 OSX 上启动 Unice 上的 Upst
从 ini 文件启动 uwsgi 时崩溃,堆栈跟踪如下: Traceback (most recent call last):
我用 Django 编写了一个服务器应用程序,并使用 Tastypie 为移动应用程序提供 API,并使用本地 MySQL 服务器为数据库提供服务。 在进程被杀死或结束之前,查询似乎被缓存了。如果我在
我正在开发一个基于 Python 的应用程序(HTTP -- REST 或 jsonrpc 接口(interface)),它将用于生产自动化测试环境。这将连接到运行所有测试脚本的 Java 客户端。即
我尝试在 nginx+uwsgi、os - debian (3.1.0-1-amd64 x86_64) 上为 django 建立网络服务器 nginx 1.1.8-1,uwsgi 0.9.8.3-1
我是一名优秀的程序员,十分优秀!