run-uwsgi.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env sh
  2. set -e
  3. UWSGI_LISTEN="${UWSGI_LISTEN:-128}"
  4. MIN_WORKERS="${MIN_WORKERS:-4}"
  5. INITIAL_WORKERS="${INITIAL_WORKERS:-6}"
  6. MAX_WORKERS="${MAX_WORKERS:-8}"
  7. OVERLOAD_TIME="${OVERLOAD_TIME:-30}"
  8. UWSGI_THREADS=${UWSGI_THREADS:-1}
  9. echo "Running uwsgi with INITIAL_WORKERS: $INITIAL_WORKERS, MIN_WORKERS: $MIN_WORKERS, MAX_WORKERS: $MAX_WORKERS, OVERLOAD_TIME: $OVERLOAD_TIME, THREADS: $UWSGI_THREADS"
  10. exec uwsgi \
  11. --module=glitchtip.wsgi:application \
  12. --env DJANGO_SETTINGS_MODULE=glitchtip.settings \
  13. --master --pidfile=/tmp/project-master.pid \
  14. --log-x-forwarded-for \
  15. --log-format-strftime \
  16. --http-socket=:$PORT \
  17. --cheaper-algo=busyness \
  18. --cheaper=$MIN_WORKERS \
  19. --cheaper-initial=$INITIAL_WORKERS \
  20. --workers=$MAX_WORKERS \
  21. --cheaper-overload=$OVERLOAD_TIME \
  22. --cheaper-step=1 \
  23. --cheaper-busyness-max=50 \
  24. --cheaper-busyness-min=25 \
  25. --cheaper-busyness-multiplier=20 \
  26. --threads=$UWSGI_THREADS \
  27. --harakiri=60 \
  28. --max-requests=10000 \
  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