File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ ENV PYTHONUNBUFFERED 1
44
55WORKDIR /app
66
7- RUN apk add --no-cache gcc musl-dev python3-dev libffi-dev
7+ RUN apk add --no-cache gcc musl-dev python3-dev libffi-dev openssl-dev
88
99COPY ./requirements.txt /app/requirements.txt
1010RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ services:
1212 - /etc/letsencrypt/live/diningfee.iiti.ac.in/privkey.pem:/etc/letsencrypt/live/diningfee.iiti.ac.in/privkey.pem
1313 env_file :
1414 - ./.env
15+ environment :
16+ - GUNICORN_WORKERS=9
17+ - GUNICORN_THREADS=4
18+ - GUNICORN_TIMEOUT=300
1519
1620 nginx :
1721 build : ./nginx
Original file line number Diff line number Diff line change @@ -8,4 +8,15 @@ python manage.py migrate --noinput
88python manage.py collectstatic --noinput
99
1010# Start server
11- gunicorn messWebsite.wsgi:application --bind 0.0.0.0:8000 --workers=16 --preload --timeout 300
11+ # Counts are env-tunable (see docker-compose.yml). gthread + --max-requests keep
12+ # memory bounded; the previous 16 sync workers were OOM-killed under load.
13+ gunicorn messWebsite.wsgi:application \
14+ --bind 0.0.0.0:8000 \
15+ --worker-class=gthread \
16+ --workers=" ${GUNICORN_WORKERS:- 3} " \
17+ --threads=" ${GUNICORN_THREADS:- 4} " \
18+ --timeout=" ${GUNICORN_TIMEOUT:- 300} " \
19+ --graceful-timeout=30 \
20+ --max-requests=1000 \
21+ --max-requests-jitter=100 \
22+ --preload
Original file line number Diff line number Diff line change 9898 "default" : {
9999 "ENGINE" : "django.db.backends.sqlite3" ,
100100 "NAME" : BASE_DIR / "db.sqlite3" ,
101+ "OPTIONS" : {
102+ # Wait up to 30s for the write lock instead of failing fast with
103+ # "database is locked" under concurrent writes.
104+ "timeout" : 30 ,
105+ "transaction_mode" : "IMMEDIATE" ,
106+ },
101107 }
102108}
103- DATABASE_OPTIONS = {"timeout" : 30 }
104109
105110
106111# DATABASES = {
Original file line number Diff line number Diff line change @@ -15,3 +15,4 @@ django-cloudinary-storage==0.3.0
1515gunicorn == 23.0.0
1616whitenoise == 6.4.0
1717django-cors-headers == 4.7.0
18+ PyJWT [crypto ]== 2.10.1
You can’t perform that action at this time.
0 commit comments