Skip to content

Commit 086c6e4

Browse files
committed
Switch to gunicorn
Historically, this repo has used waitress instead of gunicorn which I am more familiar with. This dates back to when Micah set this repo up. However, I get alerted when the site goes down or has issues. Since switching to Fly and more specifically since having the async views, I've seen some issues on Fly with the site. I'm hoping by using gunicorn with some limits that the issues go away.
1 parent 8061709 commit 086c6e4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,4 @@ RUN date -u +'%Y-%m-%dT%H:%M:%SZ' > BUILD_DATE
4545

4646
EXPOSE 8000
4747

48-
# Increase the timeout since these PDFs take a long time to generate
49-
CMD ["waitress-serve", "--port=8000", "config.wsgi:application"]
48+
CMD ["gunicorn", "--timeout", "15", "--bind", ":8000", "--workers", "2", "--max-requests", "10000", "--max-requests-jitter", "100", "config.wsgi"]

requirements/common.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Django==3.2.18
77
pytz==2022.7.1
88

99
# A zero dependency WSGI server
10-
waitress==2.1.2
10+
gunicorn==20.1.0
1111

1212
# For connecting to various APIs (eg. Meetup.com)
1313
requests==2.22.0

0 commit comments

Comments
 (0)