Skip to content

Commit

Permalink
Update gunicorn conf (#1077)
Browse files Browse the repository at this point in the history
  • Loading branch information
trent-codecov authored Jan 2, 2025
1 parent a65a329 commit aaed14e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion enterprise.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ then
python manage.py migrate
python manage.py migrate --database "timeseries" timeseries
# Start api
${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}
${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}
elif [[ "$1" = "rti" ]];
then
# Start api
Expand Down
12 changes: 8 additions & 4 deletions prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ if [ -f "/usr/local/bin/berglas" ]; then
prefix="berglas exec --"
fi

export PROMETHEUS_MULTIPROC_DIR="${PROMETHEUS_MULTIPROC_DIR:-$HOME/.prometheus}"
rm -r ${PROMETHEUS_MULTIPROC_DIR?}/* 2> /dev/null
mkdir -p "$PROMETHEUS_MULTIPROC_DIR"
GUNICORN_WORKERS=${GUNICORN_WORKERS:-2}
if [ "$GUNICORN_WORKERS" -gt 1 ];
then
export PROMETHEUS_MULTIPROC_DIR="${PROMETHEUS_MULTIPROC_DIR:-$HOME/.prometheus}"
rm -r ${PROMETHEUS_MULTIPROC_DIR?}/* 2> /dev/null
mkdir -p "$PROMETHEUS_MULTIPROC_DIR"
fi

$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}"
$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
15 changes: 7 additions & 8 deletions staging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ prefix=""
if [ -f "/usr/local/bin/berglas" ]; then
prefix="berglas exec --"
fi
suffix=""
if [[ "$STATSD_HOST" ]]; then
suffix="--statsd-host ${STATSD_HOST}:${STATSD_PORT}"
fi

export PROMETHEUS_MULTIPROC_DIR="${PROMETHEUS_MULTIPROC_DIR:-$HOME/.prometheus}"
rm -r ${PROMETHEUS_MULTIPROC_DIR?}/* 2> /dev/null
mkdir -p "$PROMETHEUS_MULTIPROC_DIR"
if [ "$GUNICORN_WORKERS" -gt 1 ];
then
export PROMETHEUS_MULTIPROC_DIR="${PROMETHEUS_MULTIPROC_DIR:-$HOME/.prometheus}"
rm -r ${PROMETHEUS_MULTIPROC_DIR?}/* 2> /dev/null
mkdir -p "$PROMETHEUS_MULTIPROC_DIR"
fi

$prefix gunicorn codecov.wsgi:application --reload --workers=2 --bind 0.0.0.0:8000 --access-logfile '-' --timeout "${GUNICORN_TIMEOUT:-600}" $suffix
$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 comments on commit aaed14e

Please sign in to comment.