Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python uWSGI“;“杀死”;开始后不久_Python_Docker_Nginx_Flask_Uwsgi - Fatal编程技术网

Python uWSGI“;“杀死”;开始后不久

Python uWSGI“;“杀死”;开始后不久,python,docker,nginx,flask,uwsgi,Python,Docker,Nginx,Flask,Uwsgi,我正试图在uWSGI开发服务器上运行我的FlaskAPI。在我的uwsgi.ini中,我有: [uwsgi] module = api callable = app master = true 当我运行uwsgi--socket 0.0.0:5002--protocol uwsgi--ini./uwsgi.ini时,它开始正确运行,打印它正在加载我的一个模型,但它只是说“Killed”并退出。我怎样才能获得更多关于退出原因的信息?谢谢 完整输出: [uWSGI] getting INI con

我正试图在uWSGI开发服务器上运行我的FlaskAPI。在我的uwsgi.ini中,我有:

[uwsgi]
module = api
callable = app
master = true
当我运行
uwsgi--socket 0.0.0:5002--protocol uwsgi--ini./uwsgi.ini
时,它开始正确运行,打印它正在加载我的一个模型,但它只是说“Killed”并退出。我怎样才能获得更多关于退出原因的信息?谢谢

完整输出:

[uWSGI] getting INI configuration from ./uwsgi.ini
*** Starting uWSGI 2.0.18 (64bit) on [Mon Jul 15 19:55:29 2019] ***
compiled with version: 6.3.0 20170516 on 15 July 2019 18:05:17
os: Linux-4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018
nodename: b8e2862b0584
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /opt/app/Paraphrasing/Paraphrase_Demo
detected binary path: /usr/local/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 0.0.0.0:5002 fd 3
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 3.7.3 (default, Jun 11 2019, 01:05:09)  [GCC 6.3.0 20170516]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x5646a0f5a310
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145840 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
WRN: Linux system doesn't support windows job object yet. OS: Unix 4.9.125.0
Set device to: -2
Load model from /opt/app/en_v0.4/model.11
Model loaded in 3691ms
Loading Finish from Files: 07/15/2019 19:55:36
The pre-trained model you are loading is a cased model but you have not set `do_lower_case` to False. We are setting `do_lower_case=False` for you but you may want to check this behavior.
| [en] dictionary: 40000 types
| [zh] dictionary: 40000 types
| loading model(s) from ../Paraphrase_Demo/models/enzh/checkpoint/checkpoint_2_152000.pt
Killed

编辑:Flask应用程序本身没有实际启动,服务器在api.py顶部的导入过程中被杀死,然后应用程序才运行。此外,flask应用程序在开发模式下运行良好。

您是否尝试在flask应用程序中打开更多日志记录?您运行它的实际环境是什么?(您已将此标记为“docker”,但在问题中没有明显提及docker。)它“感觉”像是内存不足错误,您可能会看到
dmesg
是否报告了Linux OOM杀手。@kichik不,我没有t@DavidMaze我在“python:3”图像的docker容器中运行。什么样的docker?(Docker Toolbox、Docker for Mac/Windows、Linux主机上的本机Docker?)您是否在
Docker run-m
选项或
Docker compose.yml
文件中指定了任何类型的资源限制?您是否尝试在Flask应用程序中打开更多日志记录?您运行它的实际环境是什么?(您已将此标记为“docker”,但在问题中没有明显提及docker。)它“感觉”像是内存不足错误,您可能会看到
dmesg
是否报告了Linux OOM杀手。@kichik不,我没有t@DavidMaze我在“python:3”图像的docker容器中运行。什么样的docker?(Docker Toolbox、Mac/Windows Docker、Linux主机上的本机Docker?)您是否在
Docker run-m
选项或
Docker compose.yml
文件中指定任何类型的资源限制?