From fd93fed81f7e070065a479121e69cb2a411b2877 Mon Sep 17 00:00:00 2001 From: Irwan Fathurrahman Date: Wed, 6 Nov 2024 16:44:17 +0700 Subject: [PATCH] Configure uwsgi for small resource (#731) * Configure uwsgi for small resource * Bump version 4.9.4 --- deployment/docker/uwsgi.conf | 11 +++++------ django_project/version/version.txt | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/deployment/docker/uwsgi.conf b/deployment/docker/uwsgi.conf index 4917f33..fc65239 100644 --- a/deployment/docker/uwsgi.conf +++ b/deployment/docker/uwsgi.conf @@ -7,7 +7,6 @@ module = core.wsgi master = true pidfile=/tmp/django.pid workers = 4 -cheaper = 2 env = DJANGO_SETTINGS_MODULE=core.settings.prod memory-report = true harakiri = 4800 @@ -28,15 +27,15 @@ py-callos-afterfork = true ; allow workers to trap signals max-requests = 1000 ; Restart workers after this many requests max-worker-lifetime = 3600 ; Restart workers after this many seconds -reload-on-rss = 2048 ; Restart workers after this much resident memory +reload-on-rss = 1024 ; Restart workers after this much resident memory worker-reload-mercy = 60 ; How long to wait before forcefully killing workers cheaper-algo = busyness -processes = 128 ; Maximum number of workers allowed -cheaper = 8 ; Minimum number of workers allowed -cheaper-initial = 16 ; Workers created at startup +processes = 10 ; Maximum number of workers allowed +cheaper = 2 ; Minimum number of workers allowed +cheaper-initial = 4 ; Workers created at startup cheaper-overload = 1 ; Length of a cycle in seconds -cheaper-step = 16 ; How many workers to spawn at a time +cheaper-step = 1 ; How many workers to spawn at a time cheaper-busyness-multiplier = 30 ; How many cycles to wait before killing workers cheaper-busyness-min = 20 ; Below this threshold, kill workers (if stable for multiplier cycles) diff --git a/django_project/version/version.txt b/django_project/version/version.txt index e94f14f..f4cfd30 100644 --- a/django_project/version/version.txt +++ b/django_project/version/version.txt @@ -1 +1 @@ -4.9.3 \ No newline at end of file +4.9.4 \ No newline at end of file