From 97d0ece403870a5a2184350608cda448808d70ac Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Thu, 25 Feb 2021 16:57:32 +0000 Subject: Reduce worker count from 4 to 2 We'll be creating a second site instance to allow for rolling restarts, so it makes sense to half this so when we double the requests we'll effectively have 4 workers again. --- manage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manage.py') diff --git a/manage.py b/manage.py index a025e7b1..fb5ee40c 100755 --- a/manage.py +++ b/manage.py @@ -163,7 +163,7 @@ class SiteManager: "-b", "0.0.0.0:8000", "pydis_site.wsgi:application", "--threads", "8", - "-w", "4", + "-w", "2", "--max-requests", "1000", "--max-requests-jitter", "50", "--statsd-host", "graphite.default.svc.cluster.local:8125", -- cgit v1.2.3 From fc53a53db1952d785ef3ca0eca8ec54dc5971db7 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> Date: Tue, 23 Mar 2021 15:05:34 +0300 Subject: Removes Gunicorn Import In Debug mode Moves the gunicorn import below the start server command for debug mode to ensure it isn't imported if it isn't used. This solves issues with manage.py being unable to start on windows. --- manage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'manage.py') diff --git a/manage.py b/manage.py index fb5ee40c..71af23c4 100755 --- a/manage.py +++ b/manage.py @@ -7,7 +7,6 @@ import time from typing import List import django -import gunicorn.app.wsgiapp from django.contrib.auth import get_user_model from django.core.management import call_command, execute_from_command_line @@ -156,6 +155,9 @@ class SiteManager: call_command("runserver", "0.0.0.0:8000") return + # Import gunicorn only if we aren't in debug mode. + import gunicorn.app.wsgiapp + # Patch the arguments for gunicorn sys.argv = [ "gunicorn", -- cgit v1.2.3