Environment:
python 3.6
flask
flask-sqlalchemy
mysql
gunicorn
nginx
Phenomenon:
- If I run gunicorn and nginx, and connect service http address, can't connect and show 504 time-out error.
- If I only run
python flask(0.0.0.0)
, I can connect succeessful. - If I firstly
run python flask(0.0.0.0)
, andshutdown
it. Next, I rungunicorn
and nginx, I can connect successful. - But, after about 2 or 3 hours, I can't connect
http (504 error)
again. So, I must repet step3.
Try measure: add send\read time and increase buffer size in nginx conf. But that doesn't work also.
I guess the sqlalchemy
or mysql
are causing this problem because it works perfectly if I don't use either of these libraries.
Can anyone tell me how I can fix it? Thanks.