pull/1683/head
Piero Toffanin 2025-05-13 12:54:03 -04:00
rodzic 589d050f9c
commit b83abd38c1
2 zmienionych plików z 7 dodań i 18 usunięć

Wyświetl plik

@ -147,14 +147,9 @@ else
# Only set if `WEB_CONCURRENCY` is not defined, allows overriding.
# See: https://docs.gunicorn.org/en/latest/settings.html#workers
if [ -z "$WEB_CONCURRENCY" ]; then
# Default gunicorn worker count to 2 x availabe cores + 1
# nproc gives _available_ (rather than physicall present) CPU cores.
CPU_COUNT=$(nproc)
export WEB_CONCURRENCY=$((2*$CPU_COUNT+1))
echo "Setting WEB_CONCURRENCY based on $CPU_COUNT available CPU cores to start $WEB_CONCURRENCY gunicorn workers."
else
echo "Using pre-defined WEB_CONCURRENCY override to start $WEB_CONCURRENCY gunicorn workers."
export WEB_CONCURRENCY=$((2*$(nproc)+1))
fi
echo "Web concurrency set to $WEB_CONCURRENCY"
congrats

Wyświetl plik

@ -49,13 +49,7 @@ environment_check(){
# Only set if `WEB_CONCURRENCY` is not defined, allows overriding.
# See: https://docs.gunicorn.org/en/latest/settings.html#workers
if [ -z "$WEB_CONCURRENCY" ]; then
# Default gunicorn worker count to 2 x availabe cores + 1
# nproc gives _available_ (rather than physicall present) CPU cores.
CPU_COUNT=$(nproc)
export WEB_CONCURRENCY=$((2*$CPU_COUNT+1))
echo "Setting WEB_CONCURRENCY based on $CPU_COUNT available CPU cores to start $WEB_CONCURRENCY gunicorn workers."
else
echo "Using pre-defined WEB_CONCURRENCY override to start $WEB_CONCURRENCY gunicorn workers."
export WEB_CONCURRENCY=$((2*$(nproc)+1))
fi
}