khasanjon-dev / nginx-load-balancer-least-conn

Load balancer with nginx algorithm Least Connections – A request is sent to the server with the least number of active connections, again with server weights taken into consideration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Env variables

# WEB
# DEBUG must be empty in production
DEBUG=
SECRET_KEY=django-insecure
DJANGO_SETTINGS_MODULE=root.settings

# DATABASE
DB_HOST=db
DB_NAME=news
DB_USERNAME=postgres
DB_PASSWORD=solve_the_problem
DB_PORT=5432

# POSTGRES
POSTGRES_USER=postgres
POSTGRES_PASSWORD=solve_the_problem
POSTGRES_DB=news

Run the project

step 1:

  • clone the project
git clone https://github.com/khasanjon-dev/nginx-load-balancer-least-conn.git

step 2

  • cd project file
cd nginx-load-balancer-least-conn

step 3

docker compose up --build

step 4

  • open the new terminal and run this command for testing
python test.py

Technologies used

  • Python
  • Django
  • DjangoRestFramework
  • Docker
  • docker compose
  • PostgreSQL
  • Nginx

About

Load balancer with nginx algorithm Least Connections – A request is sent to the server with the least number of active connections, again with server weights taken into consideration


Languages

Language:Python 86.6%Language:Dockerfile 7.0%Language:Shell 6.5%