run-uwsgi.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env sh
  2. set -e
  3. if echo "$PORT" | grep -qF :; then
  4. HTTP_SOCKET="$PORT"
  5. else
  6. HTTP_SOCKET=":$PORT"
  7. fi
  8. UWSGI_LISTEN="${UWSGI_LISTEN:-128}"
  9. PORT="${PORT:-8000}"
  10. CHEAPER_OVERLOAD="${UWSGI_CHEAPER_OVERLOAD:-30}"
  11. MAX_REQUESTS="${UWSGI_MAX_REQUESTS:-10000}"
  12. WORKER_RELOAD_MERCY="${UWSGI_WORKER_RELOAD_MERCY:-10}"
  13. exec uwsgi \
  14. --module=glitchtip.wsgi:application \
  15. --env DJANGO_SETTINGS_MODULE=glitchtip.settings \
  16. --master --pidfile=/tmp/project-master.pid \
  17. --log-x-forwarded-for \
  18. --log-format-strftime \
  19. --http-socket=$HTTP_SOCKET \
  20. --cheaper-algo=busyness \
  21. --cheaper-overload=$CHEAPER_OVERLOAD \
  22. --cheaper-step=1 \
  23. --cheaper-busyness-max=50 \
  24. --cheaper-busyness-min=25 \
  25. --cheaper-busyness-multiplier=20 \
  26. --harakiri=60 \
  27. --max-requests=$MAX_REQUESTS \
  28. --worker-reload-mercy=$WORKER_RELOAD_MERCY \
  29. --die-on-term \
  30. --enable-threads \
  31. --single-interpreter \
  32. --post-buffering \
  33. --buffer-size=83146 \
  34. --ignore-sigpipe \
  35. --ignore-write-errors \
  36. --disable-write-exception \
  37. --listen=$UWSGI_LISTEN