kopia lustrzana https://github.com/OpenDroneMap/WebODM
Simplify
rodzic
589d050f9c
commit
b83abd38c1
9
start.sh
9
start.sh
|
@ -147,14 +147,9 @@ else
|
||||||
# Only set if `WEB_CONCURRENCY` is not defined, allows overriding.
|
# Only set if `WEB_CONCURRENCY` is not defined, allows overriding.
|
||||||
# See: https://docs.gunicorn.org/en/latest/settings.html#workers
|
# See: https://docs.gunicorn.org/en/latest/settings.html#workers
|
||||||
if [ -z "$WEB_CONCURRENCY" ]; then
|
if [ -z "$WEB_CONCURRENCY" ]; then
|
||||||
# Default gunicorn worker count to 2 x availabe cores + 1
|
export WEB_CONCURRENCY=$((2*$(nproc)+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."
|
|
||||||
fi
|
fi
|
||||||
|
echo "Web concurrency set to $WEB_CONCURRENCY"
|
||||||
|
|
||||||
congrats
|
congrats
|
||||||
|
|
||||||
|
|
16
worker.sh
16
worker.sh
|
@ -46,17 +46,11 @@ environment_check(){
|
||||||
export WO_BROKER=redis://localhost
|
export WO_BROKER=redis://localhost
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Only set if `WEB_CONCURRENCY` is not defined, allows overriding.
|
# Only set if `WEB_CONCURRENCY` is not defined, allows overriding.
|
||||||
# See: https://docs.gunicorn.org/en/latest/settings.html#workers
|
# See: https://docs.gunicorn.org/en/latest/settings.html#workers
|
||||||
if [ -z "$WEB_CONCURRENCY" ]; then
|
if [ -z "$WEB_CONCURRENCY" ]; then
|
||||||
# Default gunicorn worker count to 2 x availabe cores + 1
|
export WEB_CONCURRENCY=$((2*$(nproc)+1))
|
||||||
# nproc gives _available_ (rather than physicall present) CPU cores.
|
fi
|
||||||
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."
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue