Gunicorn workers timeout

I'm using Flask where i load some pre-trained machine learning models once. I'm also using Gunicorn usually with 2 or 4 workers to handle parallel requests.

Every request contains some texts that i want to analyze.

I'll explain my problem with a example: My Flask server with Gunicorn and 2 workers is up and loads my models once for every worker. Then i send two parallel requests. The first will run analysis on the 1st worker with 500 texts and the second on the 2nd worker with 2000 texts. The problem is that the second request will stop the analysis after some period of time and reload the models for this worker.

Does Gunicorn contains a default worker timeout and how it can be solved?

Topic parallel processing machine-learning

Category Data Science


You can use the --timeout flag to increase the worker timeout.

Run gunicorn --help for more information about the available flags

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.