There was an error while loading. Please reload this page.
1 parent 2844489 commit beb34cbCopy full SHA for beb34cb
1 file changed
compose/fastapi/start-backend-datadog
@@ -12,11 +12,20 @@ set -o errexit
12
set -o pipefail
13
set -o nounset
14
15
+
16
+NUM_WORKERS=1
17
+if command -v nproc >/dev/null 2>&1; then
18
+ NUM_WORKERS=$(nproc)
19
+ echo "Starting app with $NUM_WORKERS workers..."
20
+else
21
+ echo "No nproc, defaulting to 1 worker..."
22
+fi
23
24
# https://www.uvicorn.org/settings/
25
export UVICORN_HOST="0.0.0.0"
26
export UVICORN_PORT=80
27
28
uvicorn main:app \
29
--host ${UVICORN_HOST} --port ${UVICORN_PORT} \
30
--reload --proxy-headers \
- --log-config uvicorn_disable_logging.json
31
+ --log-config uvicorn_disable_logging.json --workers ${NUM_WORKERS}
0 commit comments