chore: change default thumbnail concurrency and auto-detect container core count (#9981)

* feat: automatically detect amount of CPU cores and allow overriding with CPU_CORES env var

* chore: change default thumbnail concurrency to 3
This commit is contained in:
Zack Pollard
2024-06-05 11:45:53 +01:00
committed by GitHub
parent b2761b12d1
commit abf6fc25f7
8 changed files with 75 additions and 12 deletions

View File

@@ -17,4 +17,10 @@ read_file_and_export "DB_USERNAME_FILE" "DB_USERNAME"
read_file_and_export "DB_PASSWORD_FILE" "DB_PASSWORD"
read_file_and_export "REDIS_PASSWORD_FILE" "REDIS_PASSWORD"
export CPU_CORES="${CPU_CORES:=$(./get-cpus.sh)}"
echo "Detected CPU Cores: $CPU_CORES"
if [ "$CPU_CORES" -gt 4 ]; then
export UV_THREADPOOL_SIZE=$CPU_CORES
fi
exec node /usr/src/app/dist/main "$@"