From 1da59362cd0b2df446fe7c1335333240be678445 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 9 Jul 2024 13:27:32 -0700 Subject: [PATCH] mailman: adjust some settings to try and avoid OOM Set django to have 4 workers and have a retry longer than the timeout. Disable local memcached and use the memcached01 instance. Enabled debug logging on gunicorn to see what it's doing. Signed-off-by: Kevin Fenzi --- roles/mailman3/tasks/main.yml | 4 ++-- roles/mailman3/templates/mailmanweb.service.j2 | 2 +- roles/mailman3/templates/settings.py.j2 | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/roles/mailman3/tasks/main.yml b/roles/mailman3/tasks/main.yml index ea5efeb352..46c0817d02 100644 --- a/roles/mailman3/tasks/main.yml +++ b/roles/mailman3/tasks/main.yml @@ -425,8 +425,8 @@ - name: Enable memcached ansible.builtin.systemd: name: memcached - state: started - enabled: yes + state: stopped + enabled: no tags: - mailman - systemd diff --git a/roles/mailman3/templates/mailmanweb.service.j2 b/roles/mailman3/templates/mailmanweb.service.j2 index ff45926468..5c7a5ec7e9 100644 --- a/roles/mailman3/templates/mailmanweb.service.j2 +++ b/roles/mailman3/templates/mailmanweb.service.j2 @@ -11,5 +11,5 @@ Type=simple User=mailman Group=mailman WorkingDirectory=/etc/mailman3 -ExecStart=/usr/bin/gunicorn --max-requests 50000 --timeout 1000 --workers={{ mailman_gunicorn_workers }} --forwarded-allow-ips="*" mailman_web.wsgi +ExecStart=/usr/bin/gunicorn --max-requests 50000 --timeout 1000 --workers={{ mailman_gunicorn_workers }} --log-devel=debug --forwarded-allow-ips="*" mailman_web.wsgi ExecStop=/bin/kill -s TERM $MAINPID diff --git a/roles/mailman3/templates/settings.py.j2 b/roles/mailman3/templates/settings.py.j2 index 55300cc9b5..d7d33c2fef 100644 --- a/roles/mailman3/templates/settings.py.j2 +++ b/roles/mailman3/templates/settings.py.j2 @@ -311,6 +311,8 @@ HAYSTACK_CONNECTIONS = { # Q_CLUSTER = { 'timeout': 300, + 'retry': 600, + 'workers': 4, 'save_limit': 100000, 'orm': 'default', } @@ -383,11 +385,11 @@ LOGGING = { } -# Cache: use the local memcached server +# Cache: use the remote memcached server CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache', - 'LOCATION': '127.0.0.1:11211', + 'LOCATION': 'memcached01:11211', } }