I am running a Flask app on Google App Engine using Gunicorn's async workers.
Every time requests come in, after the last request is finished responding, I get the following message and my gunicorn workers exit. Then, theres a slight delay when the next batch of requests come in.
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)
Here is my app.yaml
runtime: python37
entrypoint: gunicorn --worker-class eventlet -c gunicorn.conf.py -b :$PORT main:app preload_app=True
instance_class: F2
Here is my gunicorn.conf.py file
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
I tried searching SO and some other sources but can't find a workaround for this.