Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set a custom gunicorn worker timeout when serving an MLflow model with the "mlflow models serve" CLI?

Tags:

mlflow

When serving an MLflow Python model with the "pyfunc" backend (https://github.com/mlflow/mlflow/blob/master/mlflow/pyfunc/backend.py), how can I set a custom gunicorn worker timeout? The default timeout of 60 seconds may be insufficient when serving large models that take a long time to load.

like image 722
Corey Zumar Avatar asked Nov 16 '25 20:11

Corey Zumar


1 Answers

As of MLflow 1.2, you can set a custom gunicorn timeout by specifying the GUNICORN_CMD_ARGS environment variable. The following example serves a model with a worker timeout of 120 seconds

GUNICORN_CMD_ARGS="--timeout 120" mlflow models serve --model-uri /path/to/model

like image 94
Corey Zumar Avatar answered Nov 18 '25 21:11

Corey Zumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!