diff --git a/vendor/python.gunicorn.sh b/vendor/python.gunicorn.sh index e8226579ac7ddd9b5e46dc9b3f35718d10356e7c..9a1c395f4359670037b0e9b052e1d9f639dc9911 100755 --- a/vendor/python.gunicorn.sh +++ b/vendor/python.gunicorn.sh @@ -1,32 +1,38 @@ +if [[ "${WEB_CONCURRENCY:-}" == 0* ]]; then + # another buildpack set a default value, with leading zero + unset WEB_CONCURRENCY +fi + case $(ulimit -u) in # Automatic configuration for Gunicorn's Workers setting. +# Leading zero padding so a subsequent buildpack can figure out that we set a value, and not the user # Standard-1X (+Free, +Hobby) Dyno 256) export DYNO_RAM=512 - export WEB_CONCURRENCY=${WEB_CONCURRENCY:-2} + export WEB_CONCURRENCY=${WEB_CONCURRENCY:-02} ;; # Standard-2X Dyno 512) export DYNO_RAM=1024 - export WEB_CONCURRENCY=${WEB_CONCURRENCY:-4} + export WEB_CONCURRENCY=${WEB_CONCURRENCY:-04} ;; # Performance-M Dyno 16384) export DYNO_RAM=2560 - export WEB_CONCURRENCY=${WEB_CONCURRENCY:-8} + export WEB_CONCURRENCY=${WEB_CONCURRENCY:-08} ;; # Performance-L Dyno 32768) export DYNO_RAM=6656 - export WEB_CONCURRENCY=${WEB_CONCURRENCY:-11} + export WEB_CONCURRENCY=${WEB_CONCURRENCY:-011} ;; esac # Automatic configuration for Gunicorn's ForwardedAllowIPS setting. -export FORWARDED_ALLOW_IPS='*' \ No newline at end of file +export FORWARDED_ALLOW_IPS='*'