0

Environment:

python 3.6
flask
flask-sqlalchemy
mysql
gunicorn
nginx

Phenomenon:

  1. If I run gunicorn and nginx, and connect service http address, can't connect and show 504 time-out error.
  2. If I only run python flask(0.0.0.0), I can connect succeessful.
  3. If I firstly run python flask(0.0.0.0), and shutdown it. Next, I run gunicorn and nginx, I can connect successful.
  4. 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.

James Jones
  • 3,850
  • 5
  • 25
  • 44
glados.ai
  • 11
  • 2

0 Answers0