Coder Social home page Coder Social logo

bandaysajid / load-balancing-using-nginx Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12 KB

This project demonstrates load balancing using NGINX and implementation of the `Round Robin algorithm` for load balancing by utilizing a node js server.

JavaScript 100.00%

load-balancing-using-nginx's Introduction

Load Balancing Using NGINX

In this project, there are two implementations available: one utilizes NGINX as a load balancing server and reverse proxy, while the other uses a Node.js server to distribute traffic to other servers.

Run npm install first

Use the nginx.conf which is in the root of this project, if you want to use nginx as the loadbalancer.

To get started, you need to create two instances of server.js, one running on PORT 9000 and the other on PORT 9001. You can then choose to use NGINX as the load balancing server or solely rely on the Node.js server for load balancing.

Please note that NGINX provides advanced load balancing features and is commonly used in production environments. The Node.js server implementation serves as a simplified demonstration of the algorithm for educational purposes.

#Here are the benchmarking results of the algorithm after using nginx as a reverse-proxy and a load balancer, the load-balancer was able to distribute traffic to both the servers equally.

Server Hostname:        127.0.0.1
Server Port:            9090

Document Path:          /
Document Length:        15 bytes

Concurrency Level:      50
Time taken for tests:   3.136 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      2520000 bytes
HTML transferred:       150000 bytes
Requests per second:    3188.64 [#/sec] (mean)
Time per request:       15.681 [ms] (mean)
Time per request:       0.314 [ms] (mean, across all concurrent requests)
Transfer rate:          784.70 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       4
Processing:     0   15  11.3     14      47
Waiting:        0   15  11.3     14      47
Total:          0   16  11.3     14      48

Percentage of the requests served within a certain time (ms)
  50%     14
  66%     20
  75%     24
  80%     26
  90%     32
  95%     36
  98%     39
  99%     40
 100%     48 (longest request)

load-balancing-using-nginx's People

Contributors

bandaysajid avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.