Site sometimes stuck in loading for a over 2 hours - flask gunicorn
lidoraz
PROOP

2 years ago

I have a website is based on python dash which servers a map and realestate assets.

Sometimes the website loses response and then loading forever until a

"stream timeout"

message appears, but still, after this message the site is still not responsible and only after few hours it becomes responsive as well.

The website is:

https://realestate1.up.railway.app/

Builder is: Nixpacks

runs on flask with command:
gunicorn app:app -t 1800 --keep-alive 1800

I usually tried different configuration on the keep alive and the -t parameter.
But unfortunately I have never found the best combination to make it work.

On my computer the website runs extremely fast without gunicorn.

What could be the issue here? how can this be solved without having multiple processes as I am limited on memory, as it loads about 600mb for loading the dataset in memory.

Looking for help, Thanks!

4 Replies

brody
EMPLOYEE

2 years ago

Try using the gevent worker process with gunicorn and configure some threads and worker processes.


lidoraz
PROOP

2 years ago

I see that some code is needed to be changed, how about adding more threads to the main process?How does gunicorn differs from gevent


lidoraz
PROOP

2 years ago

I see that some code is needed to be changed, how about adding more threads to the main process?How does gunicorn differs from gevent?


brody
EMPLOYEE

2 years ago

It would be of great benefit if you were able to familiarize yourself with the topics at hand.


Loading...