Professional Documents
Culture Documents
Submitted By
Sarthak Goyal
Enrolment No.: R110218138
SAP ID: 500067706
Semester VI
B. Tech. (Computer Sc. and Engineering)
Specialization in CCVT
Submitted To
Ms. Shelly
Experiment 6:
Aim: Implement Load Balancing on Cloud Platform(Django) for Application
Requirements: Python(2.7.x or 3.4.x), virtualenv, Django, Any IDE(Microsoft Visual Code,
Atom), easy_install, pip, NGINX.
The role of load balancing is to efficiently distribute the incoming network traffic across a
group of backend servers.
In this experiment, we will implement load balancing using NGINX.
Step 1: Download & Install NGINX for Mac OS X using the following command in terminal
sudo nginx
Step 3: Test NGINX by visiting http://localhost:8080 on your browser. Output will show that
NGINX is running correctly.
2
Roll No: R110218138 CAD LAB
SAP ID: 500067706
nano /usr/local/etc/nginx/nginx.conf
Configure the upstream and server parts on http bracket like following
upstream jeng-goh {
server localhost:8000;
server localhost:8888;
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://jeng-goh;
}
3
Roll No: R110218138 CAD LAB
SAP ID: 500067706
}
Here we set two ports: 8000 & 8088. On these two ports we are going to run two of our
Django projects and then check NGINX. If it is working, then the Load Balancer has been
implemented successfully.
Project 1 will be run on port 8000 using the following commands
cd Desktop/cloudapp
source bin/activate
cd mysite
python manage.py runserver 8000
4
Roll No: R110218138 CAD LAB
SAP ID: 500067706
Project 2 will be run on port 8088 using the following commands
cd Desktop/cloudapp
source bin/activate
cd tutorial
python manage.py runserver 8088
END OF EXERCISE