Skip to content

Commit 6721c45

Browse files
authored
Merge pull request #1090 from readthedocs/davidfischer/gevent-gunicorn
Adds gevent as a production option
2 parents 217218b + f3a4971 commit 6721c45

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

docker-compose/django/start

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ set -o nounset
1010
# Don't auto-migrate locally because this can cause weird issues when testing migrations
1111
# python manage.py migrate
1212
python manage.py runserver 0.0.0.0:5000
13+
14+
# In production, we use gunicorn
15+
# This gets us close to that setting for development and testing
16+
# https://docs.gunicorn.org/en/stable/settings.html
17+
#gunicorn config.wsgi --bind 0.0.0.0:5000 --reload --log-file - --access-logfile -

requirements/production.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
-r base.in
22

33
# Gunicorn is the WSGI server used to run Django
4-
gunicorn
4+
# For an app where the vast majority of requests are I/O bound API requests
5+
# gevent may be a good choice for increased concurrency
6+
# https://docs.gunicorn.org/en/stable/design.html#choosing-a-worker-type
7+
# https://docs.gunicorn.org/en/stable/settings.html#worker-class
8+
gunicorn[gevent]
59

610
# Database driver
711
# https://www.psycopg.org/psycopg3/docs/basic/install.html

requirements/production.txt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ frozenlist==1.8.0
120120
# aiosignal
121121
geoip2==5.1.0
122122
# via -r base.in
123-
gunicorn==23.0.0
123+
gevent==25.9.1
124+
# via gunicorn
125+
greenlet==3.2.4
126+
# via gevent
127+
gunicorn[gevent]==23.0.0
124128
# via -r production.in
125129
hiredis==3.3.0
126130
# via redis
@@ -156,9 +160,9 @@ propcache==0.4.1
156160
# via
157161
# aiohttp
158162
# yarl
159-
psycopg[binary,pool]==3.2.10
163+
psycopg[binary,pool]==3.2.11
160164
# via -r production.in
161-
psycopg-binary==3.2.10
165+
psycopg-binary==3.2.11
162166
# via psycopg
163167
psycopg-pool==3.2.6
164168
# via psycopg
@@ -185,7 +189,7 @@ requests==2.32.5
185189
# django-slack
186190
# geoip2
187191
# stripe
188-
sentry-sdk==2.42.0
192+
sentry-sdk==2.42.1
189193
# via -r production.in
190194
six==1.17.0
191195
# via python-dateutil
@@ -234,3 +238,10 @@ whitenoise==6.11.0
234238
# via -r base.in
235239
yarl==1.22.0
236240
# via aiohttp
241+
zope-event==6.0
242+
# via gevent
243+
zope-interface==8.0.1
244+
# via gevent
245+
246+
# The following packages are considered to be unsafe in a requirements file:
247+
# setuptools

0 commit comments

Comments
 (0)