我正在使用gunicorn运行Flask应用程序。
下面是我的app.yaml文件,它在本地与我的Google计算机引擎上的文件完全相同。
runtime: python
runtime_config:
python_version: 3
env: flex
entrypoint: gunicorn -b:$PORT main:app
当我在本地运行它时,工作人员会正确生成,并且在超时的情况下也可以正确退出。
[2018-11-19 12:25:51 +0000] [23511] [CRITICAL] WORKER TIMEOUT (pid:23514)
[2018-11-19 12:25:51 +0000] [23514] [INFO] Worker exiting (pid: 23514)
[2018-11-19 12:25:51 +0000] [23519] [INFO] Booting worker with pid: 23519
[2018-11-19 12:28:15 +0000] [23511] [CRITICAL] WORKER TIMEOUT (pid:23519)
[2018-11-19 12:28:15 +0000] [23519] [INFO] Worker exiting (pid: 23519)
[2018-11-19 12:28:15 +0000] [23522] [INFO] Booting worker with pid: 23522
在Google Compute Engine上,它无法正确退出工作程序。
2018-11-19 12:28:27 default[20181116t162223] [2018-11-19 12:28:26 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:7)
2018-11-19 12:28:27 default[20181116t162223] [2018-11-19 12:28:27 +0000] [9] [INFO] Booting worker with pid: 9
2018-11-19 12:28:40 default[20181116t162223] [2018-11-19 12:28:39 +0000] [259] [INFO] Booting worker with pid: 259
然后,它会连续生成工作程序,没有超时或工作程序退出。
2018-11-19 12:44:50 default[20181116t162223] [2018-11-19 12:44:50 +0000] [31] [INFO] Booting worker with pid: 31
2018-11-19 12:45:01 default[20181116t162223] [2018-11-19 12:45:01 +0000] [369] [INFO] Booting worker with pid: 369
2018-11-19 12:45:05 default[20181116t162223] [2018-11-19 12:45:05 +0000] [33] [INFO] Booting worker with pid: 33
2018-11-19 12:45:15 default[20181116t162223] [2018-11-19 12:45:15 +0000] [371] [INFO] Booting worker with pid: 371
2018-11-19 12:45:16 default[20181116t162223] [2018-11-19 12:45:16 +0000] [73] [INFO] Booting worker with pid: 73
2018-11-19 12:45:18 default[20181116t162223] [2018-11-19 12:45:18 +0000] [35] [INFO] Booting worker with pid: 35
为什么我的Google Compute Engine无休止地催生黑匣子工人?