From e90ebf584b5ade617f096a78d47cc87dbb23223b Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Tue, 31 Oct 2023 13:26:06 +0530 Subject: [PATCH 1/2] dev: workers count --- apiserver/.env.example | 3 +++ apiserver/bin/takeoff | 2 +- deploy/selfhost/docker-compose.yml | 2 ++ deploy/selfhost/variables.env | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apiserver/.env.example b/apiserver/.env.example index 8193b5e7716..7a210bcb749 100644 --- a/apiserver/.env.example +++ b/apiserver/.env.example @@ -70,3 +70,6 @@ ENABLE_MAGIC_LINK_LOGIN="0" # Email redirections and minio domain settings WEB_URL="http://localhost" + +# Gunicorn Workers +WORKERS=2 diff --git a/apiserver/bin/takeoff b/apiserver/bin/takeoff index dc25a14e2d1..a1ab20507fa 100755 --- a/apiserver/bin/takeoff +++ b/apiserver/bin/takeoff @@ -6,4 +6,4 @@ python manage.py migrate # Create a Default User python bin/user_script.py -exec gunicorn -w 8 -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:8000 --max-requests 1200 --max-requests-jitter 1000 --access-logfile - +exec gunicorn -w $WORKERS -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:8000 --max-requests 1200 --max-requests-jitter 1000 --access-logfile - diff --git a/deploy/selfhost/docker-compose.yml b/deploy/selfhost/docker-compose.yml index 33a0f6673ce..03b33b0ad5a 100644 --- a/deploy/selfhost/docker-compose.yml +++ b/deploy/selfhost/docker-compose.yml @@ -10,6 +10,8 @@ x-app-env : &app-env - SENTRY_DSN=${SENTRY_DSN:-""} - GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET:-""} - DOCKERIZED=${DOCKERIZED:-1} + # Gunicorn Workers + - WORKERS=${WORKERS:-2} #DB SETTINGS - PGHOST=${PGHOST:-plane-db} - PGDATABASE=${PGDATABASE:-plane} diff --git a/deploy/selfhost/variables.env b/deploy/selfhost/variables.env index 1e507a54b6b..f4507c5083f 100644 --- a/deploy/selfhost/variables.env +++ b/deploy/selfhost/variables.env @@ -61,3 +61,5 @@ MINIO_ROOT_PASSWORD="secret-key" BUCKET_NAME=uploads FILE_SIZE_LIMIT=5242880 +# Gunicorn Workers +WORKERS=2 From 0350ba046adec23ac7c57609a6fab60deafab0b9 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Mon, 6 Nov 2023 07:54:04 +0000 Subject: [PATCH 2/2] dev: update the worker count variable to GUNICORN_WORKERS --- apiserver/.env.example | 2 +- apiserver/bin/takeoff | 2 +- deploy/selfhost/docker-compose.yml | 2 +- deploy/selfhost/variables.env | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apiserver/.env.example b/apiserver/.env.example index 7a210bcb749..d3ad596e559 100644 --- a/apiserver/.env.example +++ b/apiserver/.env.example @@ -72,4 +72,4 @@ WEB_URL="http://localhost" # Gunicorn Workers -WORKERS=2 +GUNICORN_WORKERS=2 diff --git a/apiserver/bin/takeoff b/apiserver/bin/takeoff index a1ab20507fa..9b09f244ea4 100755 --- a/apiserver/bin/takeoff +++ b/apiserver/bin/takeoff @@ -6,4 +6,4 @@ python manage.py migrate # Create a Default User python bin/user_script.py -exec gunicorn -w $WORKERS -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:8000 --max-requests 1200 --max-requests-jitter 1000 --access-logfile - +exec gunicorn -w $GUNICORN_WORKERS -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:8000 --max-requests 1200 --max-requests-jitter 1000 --access-logfile - diff --git a/deploy/selfhost/docker-compose.yml b/deploy/selfhost/docker-compose.yml index 03b33b0ad5a..c571291cfac 100644 --- a/deploy/selfhost/docker-compose.yml +++ b/deploy/selfhost/docker-compose.yml @@ -11,7 +11,7 @@ x-app-env : &app-env - GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET:-""} - DOCKERIZED=${DOCKERIZED:-1} # Gunicorn Workers - - WORKERS=${WORKERS:-2} + - GUNICORN_WORKERS=${GUNICORN_WORKERS:-2} #DB SETTINGS - PGHOST=${PGHOST:-plane-db} - PGDATABASE=${PGDATABASE:-plane} diff --git a/deploy/selfhost/variables.env b/deploy/selfhost/variables.env index f4507c5083f..b12031126ce 100644 --- a/deploy/selfhost/variables.env +++ b/deploy/selfhost/variables.env @@ -62,4 +62,4 @@ BUCKET_NAME=uploads FILE_SIZE_LIMIT=5242880 # Gunicorn Workers -WORKERS=2 +GUNICORN_WORKERS=2