Load Balancing Container with Nginx PRESENTED BY: KUMAR MAYANK GUIDED BY: MRS.NEENA ELSA JOSE PRAKASH
OverView: • Containerization • Handling HTTP Request • Load Balancer • Nginx • Nginx Implementation • Configuring the Nginx • Demonstration • Nginx major clients • Conclusion • Reference
CONTAINERIZATION • Containerization is a lightweight alternative to full machine virtualization that involves encapsulating an application in a container with its own operating environment. • Docker containers are designed to run on everything from physical computers to virtual machines, bare- metal servers, OpenStack cloud clusters, public instance and more.
CONTAINERIZATION • Abstraction of the host system away from the containerized application. • Extremely lightweight, isolated execution environments. • Simple Dependency Management and Application Versioning
Handling HTTP Request
Server Default port no.: 80 client
server clients • Increasing load on a single server. • Less reliable
SOLUTION: • Load Balancing using multiple Duplicate server. CHALLENGE: • Each server will have it’s unique IP. • Handling multiple IPs.
LOAD BALANCER • Load balancing refers to efficiently distributing incoming network traffic across a group of backend servers, also known as a server farm or server pool. • Distributes client requests or network load efficiently across multiple servers
LOAD BALANCER (cont..) • Ensures high availability and reliability by sending requests only to servers that are online • Provides the flexibility to add or subtract servers as demand dictates
NGINX: NGINX was written by Igor Sysoev, a Russian system and software engineer. From the very beginning NGINX was created with a vision on how the pressure for content and the increasing number of web and mobile users will transform the essential infrastructure elements used by the Internet focused companies.
NGINX: NGINX has been really successful with customers in a Variety of market areas which include Service providers, Media & Entertainment, Online Retail, Social Media and more. Today over 10% of the top 1,000,000 Internet web sites and 25% of the top 1,000 web sites run on NGINX, including Groupon, LivingSocial, Playdom, Zappos, Hulu, TechCrunch, Dropbox, Yandex, WordPress and many others.
NGINX: • NGINX is the best-in-class load balancing solutions used by high-traffic websites such as Dropbox, Netflix, and Zynga. • As a software-based load balancer, NGINX is much less expensive than hardware-based solutions with similar capabilities. • The comprehensive load balancing capabilities in NGINX enables to build a highly optimized application delivery network.
NGINX: (cont..) The following load balancing mechanisms (or methods) are supported in nginx: • round-robin — requests to the application servers are distributed in a round-robin fashion, • least-connected — next request is assigned to the server with the least number of active connections, • ip-hash — a hash-function is used to determine what server should be selected for the next request (based on the client’s IP address).
Default Nginx load balancing configuration: The simplest configuration for load balancing with nginx may look like the following:
Nginx Implementation:
Multiple servers Multiple clients NGINX server • Default port no.: 80
Configuring the Nginx
Configuring the Nginx • Create Container for Nginx server • Start Nginx server Container • Attach Nginx server Container
Configuring the Nginx • Install Nginx web server • Open Nginx Configuration file
Configuring the Nginx • Configuration: • Start or Restart Nginx Service
Demonstration :
NGINX users:
Conclusion: • NGINX has the lowest memory footprint possible and optimizes CPU usage while delivering maximum performance even on a very inexpensive server hardware. • NGINX supports all the major standards and protocols, providing the set of features necessary today to build a scalable web setup. • NGINX configuration is logical and flexible and allows more efficiency and scalability in day-to-day engineering.
References: • http://nginx.org/en/docs/http/load_balancing.html • http://www.hostingadvice.com/how-to/nginx-vs- apache/ • https://www.upguard.com/articles/apache-vs-nginx • https://docs.docker.com/reference/ • https://docs.docker.com/engine/reference/commandl ine/container/
Thank you. Q&A

Load Balancing Container with Nginx

  • 1.
    Load Balancing Containerwith Nginx PRESENTED BY: KUMAR MAYANK GUIDED BY: MRS.NEENA ELSA JOSE PRAKASH
  • 2.
    OverView: • Containerization • HandlingHTTP Request • Load Balancer • Nginx • Nginx Implementation • Configuring the Nginx • Demonstration • Nginx major clients • Conclusion • Reference
  • 3.
    CONTAINERIZATION • Containerization isa lightweight alternative to full machine virtualization that involves encapsulating an application in a container with its own operating environment. • Docker containers are designed to run on everything from physical computers to virtual machines, bare- metal servers, OpenStack cloud clusters, public instance and more.
  • 4.
    CONTAINERIZATION • Abstraction ofthe host system away from the containerized application. • Extremely lightweight, isolated execution environments. • Simple Dependency Management and Application Versioning
  • 5.
  • 6.
  • 7.
    server clients • Increasing loadon a single server. • Less reliable
  • 8.
    SOLUTION: • Load Balancingusing multiple Duplicate server. CHALLENGE: • Each server will have it’s unique IP. • Handling multiple IPs.
  • 9.
    LOAD BALANCER • Loadbalancing refers to efficiently distributing incoming network traffic across a group of backend servers, also known as a server farm or server pool. • Distributes client requests or network load efficiently across multiple servers
  • 10.
    LOAD BALANCER (cont..) •Ensures high availability and reliability by sending requests only to servers that are online • Provides the flexibility to add or subtract servers as demand dictates
  • 11.
    NGINX: NGINX was writtenby Igor Sysoev, a Russian system and software engineer. From the very beginning NGINX was created with a vision on how the pressure for content and the increasing number of web and mobile users will transform the essential infrastructure elements used by the Internet focused companies.
  • 12.
    NGINX: NGINX has beenreally successful with customers in a Variety of market areas which include Service providers, Media & Entertainment, Online Retail, Social Media and more. Today over 10% of the top 1,000,000 Internet web sites and 25% of the top 1,000 web sites run on NGINX, including Groupon, LivingSocial, Playdom, Zappos, Hulu, TechCrunch, Dropbox, Yandex, WordPress and many others.
  • 13.
    NGINX: • NGINX isthe best-in-class load balancing solutions used by high-traffic websites such as Dropbox, Netflix, and Zynga. • As a software-based load balancer, NGINX is much less expensive than hardware-based solutions with similar capabilities. • The comprehensive load balancing capabilities in NGINX enables to build a highly optimized application delivery network.
  • 14.
    NGINX: (cont..) The followingload balancing mechanisms (or methods) are supported in nginx: • round-robin — requests to the application servers are distributed in a round-robin fashion, • least-connected — next request is assigned to the server with the least number of active connections, • ip-hash — a hash-function is used to determine what server should be selected for the next request (based on the client’s IP address).
  • 15.
    Default Nginx loadbalancing configuration: The simplest configuration for load balancing with nginx may look like the following:
  • 16.
  • 17.
  • 18.
  • 19.
    Configuring the Nginx •Create Container for Nginx server • Start Nginx server Container • Attach Nginx server Container
  • 20.
    Configuring the Nginx •Install Nginx web server • Open Nginx Configuration file
  • 21.
    Configuring the Nginx •Configuration: • Start or Restart Nginx Service
  • 22.
  • 23.
  • 24.
    Conclusion: • NGINX hasthe lowest memory footprint possible and optimizes CPU usage while delivering maximum performance even on a very inexpensive server hardware. • NGINX supports all the major standards and protocols, providing the set of features necessary today to build a scalable web setup. • NGINX configuration is logical and flexible and allows more efficiency and scalability in day-to-day engineering.
  • 25.
    References: • http://nginx.org/en/docs/http/load_balancing.html • http://www.hostingadvice.com/how-to/nginx-vs- apache/ •https://www.upguard.com/articles/apache-vs-nginx • https://docs.docker.com/reference/ • https://docs.docker.com/engine/reference/commandl ine/container/
  • 26.

Editor's Notes

  • #5  A containerized application should not rely on or be concerned with details about the underlying host's resources or architecture. This simplifies development assumptions about the operating environment. Likewise, to the host, every container is a black box. It does not care about the details of the application inside. Containers are isolated at the process level, sharing the host's kernel. This means that the container itself does not include a complete operating system, leading to almost instant startup times. Developers can easily run hundreds of containers from their workstation without an issue. The host system does not have to be concerned with the dependencies needed to run a specific application. As long as it can run Docker, it should be able to run all Docker containers.
  • #10  routing client requests across all servers capable of fulfilling those requests in a manner that maximizes speed and capacity utilization and ensures that no one server is overworked, which could degrade performance. If a single server goes down, the load balancer redirects traffic to the remaining online servers. When a new server is added to the server group, the load balancer automatically starts to send requests to it.
  • #11  routing client requests across all servers capable of fulfilling those requests in a manner that maximizes speed and capacity utilization and ensures that no one server is overworked, which could degrade performance. If a single server goes down, the load balancer redirects traffic to the remaining online servers. When a new server is added to the server group, the load balancer automatically starts to send requests to it.
  • #18 A reverse proxy server is a type of proxy server that typically sits behind the firewall in a private network and directs client requests to the appropriate backend server. A reverse proxy provides an additional level of abstraction and control to ensure the smooth flow of network traffic between clients and servers.