+ All Categories
Home > Technology > Introducing the WSO2 Elastic Load Balancer

Introducing the WSO2 Elastic Load Balancer

Date post: 15-Jan-2015
Category:
Upload: wso2
View: 1,484 times
Download: 5 times
Share this document with a friend
Description:
 
Popular Tags:
33
WSO2 Elastic Load Balancer Chintana Wilamuna [email protected]
Transcript
Page 1: Introducing the WSO2 Elastic Load Balancer

WSO2 Elastic Load Balancer

Chintana Wilamuna [email protected]

Page 2: Introducing the WSO2 Elastic Load Balancer

Load balancer

• Distribute load among a set of nodes • Static (fixed set of nodes)

• Dynamic (add/remove nodes at runtime)

• Load balancing algorithm (Round robin / weighted RR / weighted RR least connection)

Page 3: Introducing the WSO2 Elastic Load Balancer

Session affinity / sticky sessions

• All subsequent connections within a session is served by the worker node which processed the first request of the session

• Alternate solution to session replicated backend services

Page 4: Introducing the WSO2 Elastic Load Balancer

Session replication in AppServer

• AppServer clustering – Apache Tribes • Session data storage,

1. ServiceContext (data that should only be available to the service)

2. ServiceGroupContext (common data for all the services in a service group)

3. ConfigurationContext (common data for all service groups)

• AppServer replicates session data in all 3 levels (costly compared to sticky sessions)

Page 5: Introducing the WSO2 Elastic Load Balancer

LB – Membership mgt. schemes

• Static • Dynamic Join by specifying the group name

• Hybrid (WKA) Set of well known members – static Join by specifying the group name

Page 6: Introducing the WSO2 Elastic Load Balancer

Evolution of WSO2 ELB

• Started as a solution to scale PaaS – (WSO2 Stratos)

• Stratos is a multi-tenanted PaaS • Tenant – An organization (a domain)

• Isolated from other tenants • Support multiple PaaS services • A service = WSO2 product (DSS, ESB

etc…) offered as a service

Page 7: Introducing the WSO2 Elastic Load Balancer

Evolution of WSO2 ELB cont.

• A tenant can deploy their own services, mediations, workflows etc…

• Multi-tenant services (ESB, DS, AppServer etc…)

• Stratos can provision resources on demand

• Problem: making a scalable PaaS transparent to the user

Page 8: Introducing the WSO2 Elastic Load Balancer

Solution 1

• Stratos have multi-tenant services (ESB, AppServer, DS etc…)

• User talks to Identity Server, gets an SAML token, logs into any service

• Store tenant data in Registry • Each server loads all tenant data at

startup • Can support any tenant

Page 9: Introducing the WSO2 Elastic Load Balancer

Solution 1

Page 10: Introducing the WSO2 Elastic Load Balancer

Solution 1 - Problems

• Doesn’t scale with increasing number of tenants

Page 11: Introducing the WSO2 Elastic Load Balancer

Solution 2

• Started running multiple service instances

• Put a LB in front • When the load is high LB will spin up

a new instance and shuts it off when the load decreases (autoscale)

Page 12: Introducing the WSO2 Elastic Load Balancer

Solution 2

Page 13: Introducing the WSO2 Elastic Load Balancer

Solution 2 - Problems

• When we had a large number of tenants with tens of services, took a long time to load at startup

• Some tenants stayed inactive (consumed resources)

Page 15: Introducing the WSO2 Elastic Load Balancer

Solution 3 - Problems

• When a tenant has many artifacts loading those takes time

• Initial requests for an artifact of a tenant timed out

Page 17: Introducing the WSO2 Elastic Load Balancer

Solution 4 - Problems

• LB didn’t scale to handle large number of requests

Page 18: Introducing the WSO2 Elastic Load Balancer

Solution 5

• Replace LB with multiple LBs • HW LB or DNS RR between LBs

Page 19: Introducing the WSO2 Elastic Load Balancer

Solution 5

Page 20: Introducing the WSO2 Elastic Load Balancer

Solution 5 - Problems

• Many to many relationship between LBs for synchronizing metadata

• LB is not aware of tenants • A single node might have too many

tenants

Page 21: Introducing the WSO2 Elastic Load Balancer

Solution 6

• Tenant aware load balancer

Page 22: Introducing the WSO2 Elastic Load Balancer

WSO2 ELB architecture

Page 23: Introducing the WSO2 Elastic Load Balancer

WSO2 ELB

• Autoscaling component keeps track of traffic for each cloud service cluster

• Calls EC2 API • Implementation: 2 mediators and a

task (autoscale-in and autoscale-out)

• An ESB endpoint routes requests to the correct node

Page 24: Introducing the WSO2 Elastic Load Balancer

WSO2 ELB

• Service cluster identification through Host HTTP header

• According to LB algo. select a node • If the node is down it’ll fail over to

another member • Keeps track of sticky sessions (identified by JSESSIONID)

Page 25: Introducing the WSO2 Elastic Load Balancer

WSO2 ELB

• BinaryRelay is used as a message pass through mechanism

(no building or processing the message)

• Membership discovery & mgt. – Axis2 clustering. Membership handler for each clustering domain

• Use Apache Tribes Group Mgt. Framework

Page 26: Introducing the WSO2 Elastic Load Balancer

WSO2 ELB

Page 27: Introducing the WSO2 Elastic Load Balancer

WSO2 ELB – Port mapping

Page 28: Introducing the WSO2 Elastic Load Balancer

WSO2 ELB – Port mapping

• Advertise the mapped ports when joining the cluster

• LB retrieves these as properties of the member

• When dispatching requests, get mapped real port from the member (as advertised)

Page 29: Introducing the WSO2 Elastic Load Balancer

WSO2 ELB – Autoscaling

Page 30: Introducing the WSO2 Elastic Load Balancer

WSO2 ELB – Autoscaling

• AutoscaleInMediator creates a unique token when a request comes, put into a list

• Removes this when a response is sent • LoadAnalyzerTaks periodically checks

the list. Autoscale according to config params

Page 33: Introducing the WSO2 Elastic Load Balancer

Questions?


Recommended