1 Super/Ultra-Basic Load-Balancing Introduction For AFNOG 2012 Joel Jaeggli.

Slides:



Advertisements
Similar presentations
Scheduling in Web Server Clusters CS 260 LECTURE 3 From: IBM Technical Report.
Advertisements

Module 5: TLS and SSL 1. Overview Transport Layer Security Overview Secure Socket Layer Overview SSL Termination SSL in the Hosted Environment Load Balanced.
ITIS 3110 Jason Watson. Replication methods o Primary/Backup o Master/Slave o Multi-master Load-balancing methods o DNS Round-Robin o Reverse Proxy.
Module 5: Configuring Access to Internal Resources.
CS162 Section Lecture 9. KeyValue Server Project 3 KVClient (Library) Client Side Program KVClient (Library) Client Side Program KVClient (Library) Client.
Dr. Zahid Anwar. Simplified Architecture of Linux Cluster Simplified Architecture of a Single Computer Simplified architecture of an enterprise cluster.
Module 8: Concepts of a Network Load Balancing Cluster
1 Internet Networking Spring 2004 Tutorial 13 LSNAT - Load Sharing NAT (RFC 2391)
CSE 190: Internet E-Commerce Lecture 16: Performance.
SERVER LOAD BALANCING Presented By : Priya Palanivelu.
Lesson 1: Configuring Network Load Balancing
1 Spring Semester 2007, Dept. of Computer Science, Technion Internet Networking recitation #12 LSNAT - Load Sharing NAT (RFC 2391)
Load Sharing and Balancing - Saravanan Mathialagan Masters in Computer Science Georgia State University.
Copyright © 2002 Wensong Zhang. Page 1 Free Software Symposium 2002 Linux Virtual Server: Linux Server Clusters for Scalable Network Services Wensong Zhang.
Additional SugarCRM details for complete, functional, and portable deployment.
BY- NIKHIL TRIPATHI 12MCMB10.  What is a FIREWALL?  Can & Can’t in Firewall perspective  Development of Firewalls  Firewall Architectures  Some Generalization.
Chapter 4: Managing LAN Traffic
Implementing ISA Server Publishing. Introduction What Are Web Publishing Rules? ISA Server uses Web publishing rules to make Web sites on protected networks.
Scalability Terminology: Farms, Clones, Partitions, and Packs: RACS and RAPS Bill Devlin, Jim Cray, Bill Laing, George Spix Microsoft Research Dec
INSTALLING MICROSOFT EXCHANGE SERVER 2003 CLUSTERS AND FRONT-END AND BACK ‑ END SERVERS Chapter 4.
Module 11: Implementing ISA Server 2004 Enterprise Edition.
On the Performance of TCP Splicing for URL-aware Redirection Ariel Cohen, Sampath Rangarajan, and Hamilton Slye The 2 nd USENIX Symposium on Internet Technologies.
Web Cache Redirection using a Layer-4 switch: Architecture, issues, tradeoffs, and trends Shirish Sathaye Vice-President of Engineering.
Clustering In A SAN For High Availability Steve Dalton, President and CEO Gadzoox Networks September 2002.
Module 10: How Middleboxes Impact Performance
Switch Features Most enterprise-capable switches have a number of features that make the switch attractive for large organizations. The following is a.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 12: Planning and Implementing Server Availability and Scalability.
Cloud Computing Computer Science Innovations, LLC.
Hiearchial Caching in Traffic Server. Hiearchial Caching  A set of techniques and mechanisms to increase the size and performance of network caches.
Draft-carpenter-v6ops-label-balance-02 Brian Carpenter Sheng Jiang (Speaker) Willy Tarreau March 2012 IPv6 Flow Label for Server Load Balancing - update.
VIRTUAL SERVERS Chapter 7. 2 OVERVIEW Exchange Server 2003 virtual servers Virtual servers in a clustering environment Creating additional virtual servers.
Ananta: Cloud Scale Load Balancing Presenter: Donghwi Kim 1.
Cisco Study Guide
Andrew Lahiff HEP SYSMAN June 2016 Hiding infrastructure problems from users: load balancers at the RAL Tier-1 1.
Linux Virtual Server Jim Lawson VAGUE/University of Vermont /
1 © 1999, Cisco Systems, Inc. 1293_07F9_c1 LocalDirector Version3.1.
Shaopeng, Ho Architect of Chinac Group
Introduction of load balancers at the RAL Tier-1
NAT、DHCP、Firewall、FTP、Proxy
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 12: Planning and Implementing Server Availability and Scalability.
Layer 3 Redundancy 1. Hot Standby Router Protocol (HSRP)
Lab A: Planning an Installation
Scaling Network Load Balancing Clusters
REPLICATION & LOAD BALANCING
Bentley Systems, Incorporated
Instructor Materials Chapter 9: Transport Layer
Affinity Depending on the application and client requirements of your Network Load Balancing cluster, you can be required to select an Affinity setting.
High Availability Linux (HA Linux)
F5 BIGIP V 9 Training.
Switch Setup Connectivity to Other locations Via MPLS/LL etc
Securing the Network Perimeter with ISA 2004
Network Load Balancing Functionality
Network Load Balancing
Module 8: Concepts of a Network Load Balancing Cluster
VIRTUAL SERVERS Presented By: Ravi Joshi IV Year (IT)
Chapter 4 Data Link Layer Switching
How data travels through a network The Internet
Processes The most important processes used in Web-based systems and their internal organization.
Introduction to Networking
Network Architecture Introductory material
Virtual LANs.
CompTIA Server+ Certification (Exam SK0-004)
Working at a Small-to-Medium Business or ISP – Chapter 7
Advanced Network Training
Review of Important Networking Concepts
Chapter 4: EtherChannel and HSRP
Cloud Computing Architecture
LOAD BALANCING INSTANCE GROUP APPLICATION #1 INSTANCE GROUP Overview
Computer Networks Protocols
Chapter 4: EtherChannel and HSRP
Presentation transcript:

1 Super/Ultra-Basic Load-Balancing Introduction For AFNOG 2012 Joel Jaeggli

2 What is Load-balancing ● The act of dividing a workload between N > 1 devices capable for performing a task. ● Multiple contexts in internet services where this concept occurs. ● DNS ● MX records ● Multiple links (L2 trunks, L3 ECMP) ● Multiple servers

3 Goals ● Greater scalability ● Higher availability ● Reduced cost

4 Examples – L2 trunk or L3 ECMP ● Stateless per-flow-load balancing ● Per-packet causes reordering so... ● XOR 5-tuple

5 L3+L4 L4 or L7 Load-balancing ● IP+TCP or Application layer (http(s) imap etc)

6 Applications ● L2/L3 Switches ● LACP ● L3ECMP ● L4+ ● Haproxy (L4, L7) ● NGINX (L7) ● F5 LTM ● A10 ● Netscalar

7 So what does an L4 load Balancer do. ● Looks and the Destination IP and Port to determine which pool of servers a connections is mount for. ● Forwards the incoming connection to one pool member on the basis of policy. ● Could be one-sided e.g. Direct-Server-Return ● Or Source-NAT ● Keep the connection pinned to the particular pool member by tracking the connection. ● How do you track?

8 5-tuple ● What is a 5-tuple ● XOR hash of source/dest ip, source/dest port, protocol number. ● IP header

9 5-tuple continued ● TCP Headers

10 What does an L7 load balancer do? ● An L7 load balancer answers incoming connection requests. ● It understands the protocol being spoken across the connection (e.g. HTTP IMAP FTP etc). ● On the basis of either 5-tuple hash or some higher layer value, (example a URI or a cookie or both) the request is directed to a member of the appropriate pool. ● L7 is another word for proxy or ALG (Application Layer Gateway).

11 Isn't L7 going to be slower than L4? ● Probably but not always. ● Importantly there are optimizations that can reduce the expense. ● TCP syn-cookies ● Connection pooling ● Consider 3-way handshake

12 Applications - Cont ● Open source ● Apache mod_proxy_balance ● Haproxy ● NGNIX ● LVS

13 Applications Commercial ● Commercial ● F5 ● Netscalar ● A10 ● Benefits of a commercial approach ● Coordination of supporting elements – Routing – DNS – Complex health checks – HA ● Can have ASIC based acceleration.

14 High Availability Approaches ● Active-Passive ● VRRP ● State replication ● Active-Active ● State-replication considerations ● Horizontally scaled ● GTM – DNS based approach ● L3ECMP (routed)

15 HA – active/passive

16 HA – active/passive - failover

17 HA – active/passive failover with replication

18 Active / Passive ● Active-passive failover requires a mechanism ● Could use: ● VRRP (Virtual Router Redundancy Protocol) ● CARP (Common Address Redundancy Protocol) ● If failover is not coordinated with load-balancer- health, a failed load-balancer may remain active (coordination problem). ● If state is not replicated between load balancers, failover will not account for existing connections (not a problem for short-lived connections with no affinity)

19 Active / Passive Cont ● Affinity can be preserved with a Cookie ● LVS (linux virtual server) can do state- replication (using a kernel module) ● State-replication doesn't help with scaling performance-wise (at all)

20 Active/Active

21 Active/Active – How? ● Need a mechanism to distribute requests to multiple front end load-balancers. In effect, a load balancer for your load balancers. ● HOW? ● DNS e.g. each LB has a separate ip address associated with resources it's load-balancing – Return one or more resource records either randomly or on some externally instrumented basis. – Fail load balancers in or out using health check or manually ● L2 or L3 stateless plus sticky mechanism.

22 Active/Active – Stateful vs Not ● Stateful is typically done by clusters of commercial load- balancers. State replication can be expensive and imperfect. ● At scale, can be extremely expensive ● Memory on cluster members and bandwidth/cpu for replication is the limiting factor for state and connections per section. ● Stateless ● In the DNS case resource records for a failed LB have to time out of caches before that LB stops being used. ● In the L3-ECMP case a failure will cause some fraction of connections to rehash across other load-balancers anywhere from a quarter to half (they will then be rendered out of state and lost).

23 Our Exercise - HAProxy ● We're going to deploy HAProxy to load-balance connections to two http servers. ● HAProxy can do L4 (any TCP) or L7 (HTTP) load balancing ● We're going to do L7, this allows us to access http related features, including for example including a cookie.

24 HAProxy vs NGINX ● L4 vs L7 ● HAProxy can load balance anything over TCP or do L7. ● NGINX is L7 only (HTTP(s) and IMAP/POP3). ● SSL ● HAProxy doesn't support (can't only treat as TCP) ● NGINX does, so cookies for example can be parsed, can be used for SSL offload etc. ● Model ● HAProxy is threaded, effectively allowing it to engage multiple cpus in the activity. ● NGINX uses an event driven single threaded model. ● Both have merit, HAProxy is probably more scalable.

25 Goals 1)Install and perform a basic configuration of HAProxy. 2)Configure two additional webserver instances on alternate ports in Apache. 3)Demonstrate load-balanced-http connections between them. 4)Log X-Forwarded-For. 5)Bonus: use a cookie to pin a requesting host to one server or another.

26 Bibliography ● HAProxy - ● NGNIX - ● F5 LTM - ● A10 Networks - ● Apache mod_proxy_balance ● Linux virtual server - ● Wikipedia CARP ● Wikipedia VRRP ●