Skip to content

Commit aaed14e

Browse files
Update gunicorn conf (#1077)
1 parent a65a329 commit aaed14e

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

enterprise.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ then
3131
python manage.py migrate
3232
python manage.py migrate --database "timeseries" timeseries
3333
# Start api
34-
${SUB}$prefix gunicorn codecov.wsgi:application --workers=$GUNICORN_WORKERS --bind ${CODECOV_API_BIND:-0.0.0.0}:${CODECOV_API_PORT:-8000} --access-logfile '-' ${statsd}--timeout "${GUNICORN_TIMEOUT:-600}"${POST}
34+
${SUB}$prefix gunicorn codecov.wsgi:application --workers=$GUNICORN_WORKERS --threads=${GUNICORN_THREADS:-1} --worker-connections=${GUNICORN_WORKER_CONNECTIONS:-1000} --bind ${CODECOV_API_BIND:-0.0.0.0}:${CODECOV_API_PORT:-8000} --access-logfile '-' ${statsd}--timeout "${GUNICORN_TIMEOUT:-600}"${POST}
3535
elif [[ "$1" = "rti" ]];
3636
then
3737
# Start api

prod.sh

+8-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ if [ -f "/usr/local/bin/berglas" ]; then
77
prefix="berglas exec --"
88
fi
99

10-
export PROMETHEUS_MULTIPROC_DIR="${PROMETHEUS_MULTIPROC_DIR:-$HOME/.prometheus}"
11-
rm -r ${PROMETHEUS_MULTIPROC_DIR?}/* 2> /dev/null
12-
mkdir -p "$PROMETHEUS_MULTIPROC_DIR"
10+
GUNICORN_WORKERS=${GUNICORN_WORKERS:-2}
11+
if [ "$GUNICORN_WORKERS" -gt 1 ];
12+
then
13+
export PROMETHEUS_MULTIPROC_DIR="${PROMETHEUS_MULTIPROC_DIR:-$HOME/.prometheus}"
14+
rm -r ${PROMETHEUS_MULTIPROC_DIR?}/* 2> /dev/null
15+
mkdir -p "$PROMETHEUS_MULTIPROC_DIR"
16+
fi
1317

14-
$prefix gunicorn codecov.wsgi:application --workers=2 --bind 0.0.0.0:8000 --access-logfile '-' --statsd-host ${STATSD_HOST}:${STATSD_PORT} --timeout "${GUNICORN_TIMEOUT:-600}"
18+
$prefix gunicorn codecov.wsgi:application --workers=${GUNICORN_WORKERS} --threads=${GUNICORN_THREADS:-1} --worker-connections=${GUNICORN_WORKER_CONNECTIONS:-1000} --bind 0.0.0.0:8000 --access-logfile '-' --statsd-host ${STATSD_HOST}:${STATSD_PORT} --timeout "${GUNICORN_TIMEOUT:-600}" --disable-redirect-access-to-syslog --max-requests=50000 --max-requests-jitter=300

staging.sh

+7-8
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ prefix=""
88
if [ -f "/usr/local/bin/berglas" ]; then
99
prefix="berglas exec --"
1010
fi
11-
suffix=""
12-
if [[ "$STATSD_HOST" ]]; then
13-
suffix="--statsd-host ${STATSD_HOST}:${STATSD_PORT}"
14-
fi
1511

16-
export PROMETHEUS_MULTIPROC_DIR="${PROMETHEUS_MULTIPROC_DIR:-$HOME/.prometheus}"
17-
rm -r ${PROMETHEUS_MULTIPROC_DIR?}/* 2> /dev/null
18-
mkdir -p "$PROMETHEUS_MULTIPROC_DIR"
12+
if [ "$GUNICORN_WORKERS" -gt 1 ];
13+
then
14+
export PROMETHEUS_MULTIPROC_DIR="${PROMETHEUS_MULTIPROC_DIR:-$HOME/.prometheus}"
15+
rm -r ${PROMETHEUS_MULTIPROC_DIR?}/* 2> /dev/null
16+
mkdir -p "$PROMETHEUS_MULTIPROC_DIR"
17+
fi
1918

20-
$prefix gunicorn codecov.wsgi:application --reload --workers=2 --bind 0.0.0.0:8000 --access-logfile '-' --timeout "${GUNICORN_TIMEOUT:-600}" $suffix
19+
$prefix gunicorn codecov.wsgi:application --reload --workers=${GUNICORN_WORKERS:-2} --threads=${GUNICORN_THREADS:-1} --worker-connections=${GUNICORN_WORKER_CONNECTIONS:-1000} --bind 0.0.0.0:8000 --access-logfile '-' --timeout "${GUNICORN_TIMEOUT:-600}" --disable-redirect-access-to-syslog --config=gunicorn.conf.py

0 commit comments

Comments
 (0)