From ee4e68ddcb20b0f04705ff9cf4510cafd70dc959 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Fri, 8 Mar 2024 09:10:50 -0500 Subject: [PATCH] Changing load balancing --- conf/nginx/site-enabled_aether_fastapi_gunicorn.conf | 9 +++++---- docker-compose.yml | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/conf/nginx/site-enabled_aether_fastapi_gunicorn.conf b/conf/nginx/site-enabled_aether_fastapi_gunicorn.conf index 40352b6..bc265fc 100644 --- a/conf/nginx/site-enabled_aether_fastapi_gunicorn.conf +++ b/conf/nginx/site-enabled_aether_fastapi_gunicorn.conf @@ -148,11 +148,12 @@ server { upstream fastapi_backend { - # sticky sessions - ip_hash; + # Balancing: Comment out both ip_hash and least_conn to use the default of round robin + # IP hash for sticky sessions/connections load balancing method + # ip_hash; - # enable least connections balancing method - # least_conn; + # Least connections balancing method + least_conn; # zone backend 64k; # Use NGINX Plus' shared memory diff --git a/docker-compose.yml b/docker-compose.yml index d0892fa..272f15a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -189,7 +189,7 @@ services: - ./conf/aether_fastapi_requirements_current.txt:/requirements_current.txt - ./conf/aether_api_config.py:/srv/aether_api/app/config.py - - ./logs/ae_api_red:/logs + - ./logs/ae_api:/logs - ./srv/aether_api_ln:/srv/aether_api - ./srv/hosted_files_ln:/srv/hosted_files @@ -227,7 +227,7 @@ services: - ./conf/aether_fastapi_requirements_current.txt:/requirements_current.txt - ./conf/aether_api_config.py:/srv/aether_api/app/config.py - - ./logs/ae_api_blue:/logs + - ./logs/ae_api:/logs - ./srv/aether_api_ln:/srv/aether_api - ./srv/hosted_files_ln:/srv/hosted_files @@ -265,7 +265,7 @@ services: - ./conf/aether_fastapi_requirements_current.txt:/requirements_current.txt - ./conf/aether_api_config.py:/srv/aether_api/app/config.py - - ./logs/ae_api_green:/logs + - ./logs/ae_api:/logs - ./srv/aether_api_ln:/srv/aether_api - ./srv/hosted_files_ln:/srv/hosted_files