处理信号:术语(独角兽,eventlet,烧瓶,Google App Engine)

时间:2020-05-17 17:01:44

标签: google-app-engine flask gunicorn eventlet

我正在使用Gunicorn的异步工作程序在Google App Engine上运行Flask应用。

每次请求都进入时,在最后一个请求完成响应后,我收到以下消息,我的枪械工人退出了。然后,下一批请求进入时会稍有延迟。

2020-05-17 16:57:14 default[20200517t125405]  [2020-05-17 16:57:14 +0000] [7] [INFO] Handling signal: term
2020-05-17 16:57:14 default[20200517t125405]  [2020-05-17 16:57:14 +0000] [7] [INFO] Handling signal: term
2020-05-17 16:57:14 default[20200517t125405]  [2020-05-17 16:57:14 +0000] [21] [INFO] Worker exiting (pid: 21)
2020-05-17 16:57:14 default[20200517t125405]  [2020-05-17 16:57:14 +0000] [20] [INFO] Worker exiting (pid: 20)
2020-05-17 16:57:14 default[20200517t125405]  [2020-05-17 16:57:14 +0000] [18] [INFO] Worker exiting (pid: 18)
2020-05-17 16:57:14 default[20200517t125405]  [2020-05-17 16:57:14 +0000] [14] [INFO] Worker exiting (pid: 14)
2020-05-17 16:57:14 default[20200517t125405]  [2020-05-17 16:57:14 +0000] [19] [INFO] Worker exiting (pid: 19)

这是我的 app.yaml

runtime: python37
entrypoint: gunicorn --worker-class eventlet -c gunicorn.conf.py -b :$PORT main:app preload_app=True
instance_class: F2

这是我的 gunicorn.conf.py 文件

import multiprocessing

workers = (multiprocessing.cpu_count()) * 2 + 1
threads = workers # originally didn't have this, just had the workers var defined, but tried this and it also didn't solve the problem

我尝试搜索SO和其他一些来源,但是找不到解决方法。

0 个答案:

没有答案