21
1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. [email protected] Mr. Colin Zhang [email protected] With Thanks to Prof. G. Coulouris, Prof. A.S. Tanenbaum

1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. [email protected] Mr. Colin Zhang [email protected] With Thanks to Prof. G. Coulouris,

Embed Size (px)

Citation preview

Page 1: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

1

Distributed Systems : Server Load Balancing

Dr. Sunny Jeong. [email protected]. Colin Zhang [email protected] Thanks to Prof. G. Coulouris, Prof. A.S. Tanenbaum

Page 2: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

2

Overview

Server load balancing

Introduction

Basic concepts

Static load balancing

Dynamic load balancing Load balancing in Java

Page 3: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Introduction

In computer networking, load balancing is a technique to distributed work between many computers, processes, hard disks or other resources in order to get optimal resource utilization and decrease computing time [3].

The function is performed by the load balancers.

Page 4: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Introduction – Understanding the Load Balancer

Server with a load balancer

4

Page 5: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Introduction – Understanding the Load Balancer

An easy example – Router in a call center server

Load Balancer – Software & hardware

Various other functions like • Server load balancing

• Firewall load balancing • Transparent cache switching • Server protection• Fault Tolerance

Load Balancer does not works in the application level

Page 6: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Advanced Concepts

Session Persistence

The mega proxy problem

Delayed binding

Cookie switching

Page 7: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Advanced Concepts - Session Persistence

How application that runs on top of TCP/IP protocol affects the function of load balancer –

Page 8: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Advanced Concepts – the mega proxy problem

Situations where the source IP is not a reliable way to identify a user, due to a proxy server is known as the megaproxy problem

Page 9: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Advanced Concepts

Delayed Binding Delayed binding is this process of delaying the binding of a TCP connection to a server until after the application request is received.

Cookie SwitchingReading the cookie information to solve theMega proxy problem

Page 10: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Static load balancing

No consideration of servers and network states, conducting based on preprogrammed server manuals

Round Robin Server instances called in order Simple and cheap are the advantages If one is slow others will be affected Note: not suitable FTP server (Persistency)

Weight based load balancing Weighted in scale of 1-100 depending on the load managed by

server Load distributed accordingly

Priority Group Activation Use only active server Stand by server active in needed time only Easy to maintain

10

Page 11: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Dynamic load balancing

React based on servers status and the request from client

Least connection Fastest response Least loaded (SNMP agent)

11

Page 12: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Application - Global Server Load Balancing

Domain Naming Service

Positioning the GSLB• Not to affect the existing flow• Site selection

Page 13: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Application - GSLB

Site selection based on the following [2] Site health conditions Site response time Site Loading time

Page 14: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Application – Web Caching

Caches can be installed and utilized with the Load balancers in the following ways [2] Forward proxy for client acceleration Transparent proxy for client acceleration Reverse proxy for server acceleration Transparent reverse proxy for server acceleration

Page 15: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Application – Web Caching

Transparent reverse proxy for server acceleration

Page 16: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Load Balancing in Java

Load Balancing for Servlets and JSPs

Load Balancing for EJBs and RMI Objects

Load Balancing for JDBC Connections

Page 17: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Load balancing in Java – Servlets and JSPs

Load Balancing with a Proxy Plug-in Weblogic proxy plug-in maintains as list of web logic

servlet and JSP instances

Forwards the HTTP request to those cached instances in round-robin method

Some webservers and associated proxies Weblogic server & HTTPClusterServlet Apache with Apache proxy plug-ins Microsoft IIS with IIS plugins

Page 18: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Load balancing in Java – EJB’s and RMI’s

The Object instances stored in the stubs

Techniques Round Robin Load Balancing Weight-Based Load Balancing Random Load Balancing

Page 19: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Load balancing in Java – EJB’s and RMI’s

Round Robin Load Balancing Server instances called in order Simple and cheap are the advantages If one is slow others will be affected

Weight based load balancing Weighted in scale of 1-100 depending on the load managed by

server Load distributed accordingly

Random Load Balancing Does not discrete difference in processing and assumes

homogenous systems Overhead in generating random number simple

Page 20: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

Load balancing in Java – JDBC Connection

Load balancing of JDBC connection requires the use of a multipool configured for load balancing. Load balancing support is an option you can choose when configuring a multipool

Multipool has an ordered lit of connection pool that routes the connection

Default the first connection pool if not run in load balancing mode

Page 21: 1 Distributed Systems : Server Load Balancing Dr. Sunny Jeong. spjeong@uic.edu.hk Mr. Colin Zhang colinzhang@uic.edu.hk With Thanks to Prof. G. Coulouris,

References

Load Balancing in Java

http://e-docs.bea.com/wls/docs81/cluster/load_balancing.html#1043771

Other references on load balancing from [2]

Load Balancing Servers,Firewalls, and Caches by Chandra Kopparapu

S.Mathialagan Georgia State University

IBM Technical Report