sandiegopython / pythonsd-django

http://sandiegopython.org/
MIT License
7 stars 5 forks source link

Switch to gunicorn #122

Closed davidfischer closed 1 year ago

davidfischer commented 1 year ago

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.

Specifically, I've seen requests queuing up on waitress with the following log message. This issue won't clear for many minutes. I'm not sure why waitress doesn't timeout requests and get back to a good state.

2023-03-18T00:20:45.669 app[4b9dfb35] lax [info] WARNING 2023-03-17 17:20:45,669 [waitress.queue] Task queue depth is 1
2023-03-18T00:20:45.805 app[4b9dfb35] lax [info] WARNING 2023-03-17 17:20:45,804 [waitress.queue] Task queue depth is 1
2023-03-18T00:20:52.235 app[4b9dfb35] lax [info] WARNING 2023-03-17 17:20:52,234 [waitress.queue] Task queue depth is 2
2023-03-18T00:20:55.043 app[4b9dfb35] lax [info] WARNING 2023-03-17 17:20:55,043 [waitress.queue] Task queue depth is 3
2023-03-18T00:21:03.431 app[4b9dfb35] lax [info] WARNING 2023-03-17 17:21:03,430 [waitress.queue] Task queue depth is 4
2023-03-18T00:21:08.104 app[4b9dfb35] lax [info] WARNING 2023-03-17 17:21:08,104 [waitress.queue] Task queue depth is 5
2023-03-18T00:21:13.760 app[4b9dfb35] lax [info] WARNING 2023-03-17 17:21:13,760 [waitress.queue] Task queue depth is 6
2023-03-18T00:21:15.274 app[4b9dfb35] lax [info] WARNING 2023-03-17 17:21:15,274 [waitress.queue] Task queue depth is 7
davidfischer commented 1 year ago

Thanks for the reviews!