2023-08-31 23:30:53 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
2024-02-18 23:03:01 +00:00
|
|
|
lib_path="/usr/lib/$(arch)-linux-gnu/libmimalloc.so.2"
|
2024-03-16 04:04:45 +00:00
|
|
|
# mimalloc seems to increase memory usage dramatically with openvino, need to investigate
|
2024-05-17 16:59:05 +00:00
|
|
|
if ! [ "$DEVICE" = "openvino" ]; then
|
2024-03-16 04:04:45 +00:00
|
|
|
export LD_PRELOAD="$lib_path"
|
|
|
|
export LD_BIND_NOW=1
|
|
|
|
fi
|
2023-08-31 23:30:53 +00:00
|
|
|
|
2024-05-17 16:59:05 +00:00
|
|
|
: "${IMMICH_HOST:=[::]}"
|
|
|
|
: "${IMMICH_PORT:=3003}"
|
2023-08-31 23:30:53 +00:00
|
|
|
: "${MACHINE_LEARNING_WORKERS:=1}"
|
2023-09-07 01:27:29 +00:00
|
|
|
: "${MACHINE_LEARNING_WORKER_TIMEOUT:=120}"
|
2023-08-31 23:30:53 +00:00
|
|
|
|
|
|
|
gunicorn app.main:app \
|
2023-12-14 19:51:24 +00:00
|
|
|
-k app.config.CustomUvicornWorker \
|
2024-05-17 16:59:05 +00:00
|
|
|
-b "$IMMICH_HOST":"$IMMICH_PORT" \
|
2024-02-18 23:03:01 +00:00
|
|
|
-w "$MACHINE_LEARNING_WORKERS" \
|
|
|
|
-t "$MACHINE_LEARNING_WORKER_TIMEOUT" \
|
2023-12-14 19:51:24 +00:00
|
|
|
--log-config-json log_conf.json \
|
|
|
|
--graceful-timeout 0
|