When in the Google App Engine (flexible) environment, The request hangs and times out after 120 secs ... In the logs, I am getting [CRITICAL] WORKER TIMEOUT (pid:277) error when serving the Flask app with gunicorn and gevent workers.
here is app.yaml:
runtime: python
env: flex
runtime_config:
python_version: 3
threadsafe: false
# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
automatic_scaling:
min_num_instances: 5
max_num_instances: 40
cool_down_period_sec: 180
cpu_utilization:
target_utilization: 0.85
resources:
cpu: 80
memory_gb: 80
disk_size_gb: 10
import multiprocessing
workers = multiprocessing.cpu_count() * 2 + 1
keepalive = 120
timeout = 120
worker_class = 'gevent'
worker_connections = 1000
loglevel = 'debug'
here is requirements.txt:
Flask==1.0.3
gevent==1.4.0
gunicorn==19.9.0
google-cloud-bigtable
google-cloud-happybase
locustio==0.11.0
pyzmq==18.1.0