High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
chore(ml): set higher worker timeout for openvino (#11174)
Mert88f62087fd86
diff --git a/docs/docs/install/environment-variables.md b/docs/docs/install/environment-variables.mdindex 64a3078fc8..3a0db9928d 100644--- a/docs/docs/install/environment-variables.md+++ b/docs/docs/install/environment-variables.md@@ -155,18 +155,18 @@ Redis (Sentinel) URL example JSON before encoding:## Machine Learning-| Variable | Description | Default | Containers |-| :----------------------------------------------- | :------------------------------------------------------------------- | :-----------------: | :--------------- |-| `MACHINE_LEARNING_MODEL_TTL` | Inactivity time (s) before a model is unloaded (disabled if \<= 0) | `300` | machine learning |-| `MACHINE_LEARNING_MODEL_TTL_POLL_S` | Interval (s) between checks for the model TTL (disabled if \<= 0) | `10` | machine learning |-| `MACHINE_LEARNING_CACHE_FOLDER` | Directory where models are downloaded | `/cache` | machine learning |-| `MACHINE_LEARNING_REQUEST_THREADS`<sup>\*1</sup> | Thread count of the request thread pool (disabled if \<= 0) | number of CPU cores | machine learning |-| `MACHINE_LEARNING_MODEL_INTER_OP_THREADS` | Number of parallel model operations | `1` | machine learning |-| `MACHINE_LEARNING_MODEL_INTRA_OP_THREADS` | Number of threads for each model operation | `2` | machine learning |-| `MACHINE_LEARNING_WORKERS`<sup>\*2</sup> | Number of worker processes to spawn | `1` | machine learning |-| `MACHINE_LEARNING_WORKER_TIMEOUT` | Maximum time (s) of unresponsiveness before a worker is killed | `120` | machine learning |-| `MACHINE_LEARNING_PRELOAD__CLIP` | Name of a CLIP model to be preloaded and kept in cache | | machine learning |-| `MACHINE_LEARNING_PRELOAD__FACIAL_RECOGNITION` | Name of a facial recognition model to be preloaded and kept in cache | | machine learning |+| Variable | Description | Default | Containers |+| :----------------------------------------------- | :------------------------------------------------------------------- | :-----------------------------------: | :--------------- |+| `MACHINE_LEARNING_MODEL_TTL` | Inactivity time (s) before a model is unloaded (disabled if \<= 0) | `300` | machine learning |+| `MACHINE_LEARNING_MODEL_TTL_POLL_S` | Interval (s) between checks for the model TTL (disabled if \<= 0) | `10` | machine learning |+| `MACHINE_LEARNING_CACHE_FOLDER` | Directory where models are downloaded | `/cache` | machine learning |+| `MACHINE_LEARNING_REQUEST_THREADS`<sup>\*1</sup> | Thread count of the request thread pool (disabled if \<= 0) | number of CPU cores | machine learning |+| `MACHINE_LEARNING_MODEL_INTER_OP_THREADS` | Number of parallel model operations | `1` | machine learning |+| `MACHINE_LEARNING_MODEL_INTRA_OP_THREADS` | Number of threads for each model operation | `2` | machine learning |+| `MACHINE_LEARNING_WORKERS`<sup>\*2</sup> | Number of worker processes to spawn | `1` | machine learning |+| `MACHINE_LEARNING_WORKER_TIMEOUT` | Maximum time (s) of unresponsiveness before a worker is killed | `120` (`300` if using OpenVINO image) | machine learning |+| `MACHINE_LEARNING_PRELOAD__CLIP` | Name of a CLIP model to be preloaded and kept in cache | | machine learning |+| `MACHINE_LEARNING_PRELOAD__FACIAL_RECOGNITION` | Name of a facial recognition model to be preloaded and kept in cache | | machine learning |\*1: It is recommended to begin with this parameter when changing the concurrency levels of the machine learning service and then tune the other ones.diff --git a/machine-learning/Dockerfile b/machine-learning/Dockerfileindex 1aea125a14..92d4850f38 100644--- a/machine-learning/Dockerfile+++ b/machine-learning/Dockerfile@@ -77,6 +77,7 @@ RUN apt-get update && \rm -rf /var/lib/apt/lists/*WORKDIR /usr/src/app+ARG DEVICEENV TRANSFORMERS_CACHE=/cache \PYTHONDONTWRITEBYTECODE=1 \PYTHONUNBUFFERED=1 \diff --git a/machine-learning/start.sh b/machine-learning/start.shindex 9d0a505c0c..7a35c1fd51 100755--- a/machine-learning/start.sh+++ b/machine-learning/start.sh@@ -5,12 +5,13 @@ lib_path="/usr/lib/$(arch)-linux-gnu/libmimalloc.so.2"if ! [ "$DEVICE" = "openvino" ]; thenexport LD_PRELOAD="$lib_path"export LD_BIND_NOW=1+ : "${MACHINE_LEARNING_WORKER_TIMEOUT:=120}"+else+ : "${MACHINE_LEARNING_WORKER_TIMEOUT:=300}"fi: "${IMMICH_HOST:=[::]}": "${IMMICH_PORT:=3003}"-: "${MACHINE_LEARNING_WORKERS:=1}"-: "${MACHINE_LEARNING_WORKER_TIMEOUT:=120}"gunicorn app.main:app \-k app.config.CustomUvicornWorker \