SlideShare a Scribd company logo
1 of 37
High Availability Low
Dollar Load Balancing
Simon Karpen
System Architect, VoiceThread
skarpen@voicethread.com
Via Karpen Internet Systems
skarpen@karpeninternet.com
These slides are licensed under the Creative Commons
Attribution Share-Alike 3.0 license,
http://creativecommons.org/licenses/by-sa/3.0/US/
Overview
• What is Load Balancing
• Why load balance
• What services should you load balance
• What are some common load balancing topologies
• What are some open source load balancing technologies
• How would we build a HA configuration out of these
technologies
• How do I IPv6 enable IPv4 services with a single
command line on a dual-stack machine
What is Load Balancing
• Split traffic across two or more servers
• Many different techniques and topologies
• Layer 4 or layer 7
• Useful for most TCP services
• Divides traffic using a variety of algorithms
(WLC, RR, etc)
Why Load Balance
• Improve performance
• Improve redundancy
• More cost effective scaling
o 4-socket machines cost 4x as much as 2-socket
• More cost effective redundancy
o n+1 or n+2 instead of 2n
• SSL Acceleration
• Security / IPS / Choke Point
Which Services
• Without built-in failover
• More than one infrastructure unit of
performance
• Good: web services, application services
• Probably not: DNS, inbound SMTP
• Examples: virtually any web site you visit!
• Stickiness – understand your services
Background - OSI Model
• Layer 1: Physical (cable, electrical)
• Layer 2: Datalink (example: Ethernet)
• Layer 3: Network (example: IP)
• Layer 4: Transport (example: TCP)
• Layer 5: Session
• Layer 6: Presentation
• Layer 7: Application (example: HTTP)
Topologies
• Application Proxy
• Half-NAT
• Full-NAT
• Direct Server Return
Application Proxy
Application Proxy
• Positives
o Simplest to setup
o Minimal platform dependencies
o Minimal changes to other infrastructure
o 100% Userspace
• Negatives
o Limited total performance
o Hides end user IPs from applications
Full NAT
Half NAT
Half and Full NAT
• Full NAT
o Similar to an application proxy
o Destination still doesn’t know source IP
o All packets still go through the load balancer
• Half NAT
o Destination IP is changed, source IP is not
o Allows the application to know the client
o All packets still go through the load balancer
Direct Server Return
Direct Server Return
• Incoming packets pass through the load
balancer
• Outgoing direct to the gateway / client
• Most scalable
• Most complex to configure
• Application servers must all have public
application IP, non-ARP
o via arptables, loopback, etc
Apache mod_proxy_balancer
• Application (layer 7) proxy for web
• Runs under any cluster manager
• Cookie based persistence
• Apache rewrite, redirect, etc at the load balancer
• Web (http, https) traffic only
• SSL offload / SSL issues
• Anything that runs Apache (even Windows)
Apache mod_proxy_balancer
<VirtualHost my.site.com:80>
ServerName my.site.com
ProxyPass / balancer://mysite/ lbmethod=byrequests
ProxyPassReverse / balancer://mysite
<Proxy balancer://mysite>
BalancerMember http://10.0.0.1/ route=mysite1
BalancerMember http://10.0.0.2/ route=mysite2
</Proxy>
ProxyPreserveHost On
</VirtualHost>
pen
• Runs under any cluster manager
• Simple layer 4 or layer 7 proxy
• Very simple configuration
• Moderate traffic
• Really shines for internal services
• Already IPv6 ready!
• Linux, BSD, Solaris
pen
• Configuration via command line options
• Use init scripts from web site, or roll your own
• Init scripts store command line options in pen.cf
pen –x 6144 –c 262144 –h –H –p <pidfile>
192.168.232.20:80 192.168.232.21:80 192.168.232.22:80
pen –x 500 –c 16384 –h –p <pidfile> 192.168.232.20:993
192.168.232.23:993 192.168.232.24:993
IPVS / Pulse / Piranha
• These work together as a system
• IPVS: load balancing
• Pulse: cluster manager (lightweight)
• Piranha: web interface for configuration
• EL5 version is IPv4 only
• EL6 version is IPv4 / IPv6
• Layer 4, in-kernel, Linux only
IPVS
• IP Virtual Server, implemented via Netfilter
• Controlled via ipvsadm
• Or use a front-end like piranha
• Supports persistence, many schedulers
Command line:
ipvsadm –A –t 192.168.23.20:80 –s rr
ipvsadm –a –t 192.168.23.20:80 –r 192.168.23.21:80 –m
Ipvsadm –a –t 192.168.23.20:80 –r 192.168.23.22:80 –m
Piranha
• Graphical configuration interface
• Manage Pulse and IPVS configuration
• Web based, some expensive LB use it too
• Handles half-NAT, full-NAT and DSR topologies
• Runs on port 3636, password protected
• Recommend access via ssh tunnel
Piranha - Pulse
• Simple, single purpose cluster manager
• Only supports 2-node active/passive failover
• Configured via Piranha web interface
Piranha - Pulse
Enable the Backup Server for HA
Piranha - Pulse
Configure the Redundant IP, Sync options
Piranha – Virtual Server
Add a virtual server, then Edit its configuration
Be sure to make all changes on BOTH hosts!
Piranha – Virtual Server
Piranha – Real Servers
Add two real servers, and prepare to edit
Piranha – Real Server
Configure both real servers on both hosts
Piranha - Finalize
• Configure monitoring scripts (write if needed)
• Activate real servers
• Activate virtual servers
• Add non-ARP’d VIPs on actual real servers (if
using DSR)
• Start pulse (init script) on both servers
• Test, verify, debug!
Cluster Managers
• LVS / IPVS fits well with Pulse
• Pen and Apache are simple, run under virtually
any cluster manager
• Positive experience with Heartbeat
• Choose based on organizational needs
• (aka use what your team knows!)
• Simple services, limited needs from CM
Heartbeat, pen, Apache
• Apache (on EL5/EL6) has good init scripts
• Pen init scripts from web site need killall in stop
section (otherwise it doesn’t work)
• Run under Heartbeat v1 configuration as a
service and an IP Address
• Apache init scripts ready for Heartbeat v2 /
Pacemaker / CRM
• Pen init scripts will need a rewrite
Minimal ha.cf
• ucast eth1 192.168.232.10
• ucast eth1 192.168.232.11
• keepalive 2
• warntime 10
• deadtime 30
• initdead 120
• udpport 694
• auto_failback on
• node lb0
• node lb1
• respawn hacluster /usr/lib64/heartbeat/ipfail
V1 style haresources for
Load Balancing
lb0 192.168.232.20 pen httpd
lb1
IPv6!
• Bootstrapping problem, you can help!
• LVS / IPVS supports IPv6 in EL6 but not EL5
• Pen supports IPv6 out of the box
• Apache mod_proxy supports IPv6
• Reports mixed on mod_proxy_balancer
• Could use IPv6 mod_proxy in front of IPv4
mod_proxy_balancer
Easy IPv6
• One command line, as promised!
• Uses pen, mostly cross platform (Linux / Solaris /
BSD)
• Must run on a dual stack box
• Application must be TCP, not UDP
• Run under a cluster manager for HA
pen <regular options> ipv6addr:svcport
ipv4addr:svcport
Now you can IPv6 enable your web site!
Final Thoughts
• Lots of options in terms of software and
topology
• This does not cover global load balancing
• This can be layered with global LB or ADN
• Balance performance, cost, complexity
• Think about organizational and application
needs
Questions and resources
http://siag.nu/pen/
http://httpd.apache.org/
http://docs.redhat.com/docs/en-
US/Red_Hat_Enterprise_Linux/5/html-
single/Virtual_Server_Administration/index.h
tml
http://lbwiki.org/
http://www.linuxvirtualserver.org/

More Related Content

What's hot

resource on openstack
 resource on openstack resource on openstack
resource on openstackjieun kim
 
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화OpenStack Korea Community
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLinaro
 
pfSense presentation
pfSense presentationpfSense presentation
pfSense presentationSimon Vass
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
Linux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance ShowdownLinux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance ShowdownScyllaDB
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniZalando Technology
 
Ceph Month 2021: RADOS Update
Ceph Month 2021: RADOS UpdateCeph Month 2021: RADOS Update
Ceph Month 2021: RADOS UpdateCeph Community
 
오픈스택: 구석구석 파헤쳐보기
오픈스택: 구석구석 파헤쳐보기오픈스택: 구석구석 파헤쳐보기
오픈스택: 구석구석 파헤쳐보기Jaehwa Park
 
Ceph Introduction 2017
Ceph Introduction 2017  Ceph Introduction 2017
Ceph Introduction 2017 Karan Singh
 
MyRocks introduction and production deployment
MyRocks introduction and production deploymentMyRocks introduction and production deployment
MyRocks introduction and production deploymentYoshinori Matsunobu
 
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New FeaturesAmazon Web Services
 
A crash course in CRUSH
A crash course in CRUSHA crash course in CRUSH
A crash course in CRUSHSage Weil
 
Best Practice TLS for IBM Domino
Best Practice TLS for IBM DominoBest Practice TLS for IBM Domino
Best Practice TLS for IBM DominoJared Roberts
 
Back to the future with C++ and Seastar
Back to the future with C++ and SeastarBack to the future with C++ and Seastar
Back to the future with C++ and SeastarTzach Livyatan
 
Highly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackupHighly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackupNilnandan Joshi
 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?Pradeep Kumar
 
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking ShapeBlue
 
TRex Traffic Generator - Hanoch Haim
TRex Traffic Generator - Hanoch HaimTRex Traffic Generator - Hanoch Haim
TRex Traffic Generator - Hanoch Haimharryvanhaaren
 

What's hot (20)

resource on openstack
 resource on openstack resource on openstack
resource on openstack
 
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted Firmware
 
pfSense presentation
pfSense presentationpfSense presentation
pfSense presentation
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
Linux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance ShowdownLinux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance Showdown
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando Patroni
 
Ceph Month 2021: RADOS Update
Ceph Month 2021: RADOS UpdateCeph Month 2021: RADOS Update
Ceph Month 2021: RADOS Update
 
오픈스택: 구석구석 파헤쳐보기
오픈스택: 구석구석 파헤쳐보기오픈스택: 구석구석 파헤쳐보기
오픈스택: 구석구석 파헤쳐보기
 
Ceph Introduction 2017
Ceph Introduction 2017  Ceph Introduction 2017
Ceph Introduction 2017
 
MyRocks introduction and production deployment
MyRocks introduction and production deploymentMyRocks introduction and production deployment
MyRocks introduction and production deployment
 
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
 
A crash course in CRUSH
A crash course in CRUSHA crash course in CRUSH
A crash course in CRUSH
 
Best Practice TLS for IBM Domino
Best Practice TLS for IBM DominoBest Practice TLS for IBM Domino
Best Practice TLS for IBM Domino
 
Back to the future with C++ and Seastar
Back to the future with C++ and SeastarBack to the future with C++ and Seastar
Back to the future with C++ and Seastar
 
Highly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackupHighly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackup
 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?
 
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
 
TRex Traffic Generator - Hanoch Haim
TRex Traffic Generator - Hanoch HaimTRex Traffic Generator - Hanoch Haim
TRex Traffic Generator - Hanoch Haim
 
Deep Dive on Amazon Aurora
Deep Dive on Amazon AuroraDeep Dive on Amazon Aurora
Deep Dive on Amazon Aurora
 

Similar to Load Balancing

(ATS4-PLAT01) Core Architecture Changes in AEP 9.0 and their Impact on Admini...
(ATS4-PLAT01) Core Architecture Changes in AEP 9.0 and their Impact on Admini...(ATS4-PLAT01) Core Architecture Changes in AEP 9.0 and their Impact on Admini...
(ATS4-PLAT01) Core Architecture Changes in AEP 9.0 and their Impact on Admini...BIOVIA
 
haproxy-150423120602-conversion-gate01.pdf
haproxy-150423120602-conversion-gate01.pdfhaproxy-150423120602-conversion-gate01.pdf
haproxy-150423120602-conversion-gate01.pdfPawanVerma628806
 
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...tdc-globalcode
 
HPC Controls Future
HPC Controls FutureHPC Controls Future
HPC Controls Futurercastain
 
EKON27-FrameworksTuning.pdf
EKON27-FrameworksTuning.pdfEKON27-FrameworksTuning.pdf
EKON27-FrameworksTuning.pdfArnaud Bouchez
 
Midwest PHP - Scaling Magento
Midwest PHP - Scaling MagentoMidwest PHP - Scaling Magento
Midwest PHP - Scaling MagentoMathew Beane
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyserAlex Moskvin
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)Panagiotis Kanavos
 
Training Slides: 205 - Installing and Configuring Tungsten Dashboard
Training Slides: 205 - Installing and Configuring Tungsten DashboardTraining Slides: 205 - Installing and Configuring Tungsten Dashboard
Training Slides: 205 - Installing and Configuring Tungsten DashboardContinuent
 
Open stack ha design & deployment kilo
Open stack ha design & deployment   kiloOpen stack ha design & deployment   kilo
Open stack ha design & deployment kiloSteven Li
 
Scalable Architecture 101
Scalable Architecture 101Scalable Architecture 101
Scalable Architecture 101ConFoo
 
Balázs Bucsay - XFLTReaT: Building a Tunnel
Balázs Bucsay - XFLTReaT: Building a TunnelBalázs Bucsay - XFLTReaT: Building a Tunnel
Balázs Bucsay - XFLTReaT: Building a Tunnelhacktivity
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 SystemsDavid Newman
 
IPVS for Docker Containers
IPVS for Docker ContainersIPVS for Docker Containers
IPVS for Docker ContainersBob Sokol
 
[En] IPVS for Docker Containers
[En] IPVS for Docker Containers[En] IPVS for Docker Containers
[En] IPVS for Docker ContainersAndrey Sibirev
 

Similar to Load Balancing (20)

(ATS4-PLAT01) Core Architecture Changes in AEP 9.0 and their Impact on Admini...
(ATS4-PLAT01) Core Architecture Changes in AEP 9.0 and their Impact on Admini...(ATS4-PLAT01) Core Architecture Changes in AEP 9.0 and their Impact on Admini...
(ATS4-PLAT01) Core Architecture Changes in AEP 9.0 and their Impact on Admini...
 
haproxy-150423120602-conversion-gate01.pdf
haproxy-150423120602-conversion-gate01.pdfhaproxy-150423120602-conversion-gate01.pdf
haproxy-150423120602-conversion-gate01.pdf
 
HAProxy
HAProxy HAProxy
HAProxy
 
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
 
HPC Controls Future
HPC Controls FutureHPC Controls Future
HPC Controls Future
 
EKON27-FrameworksTuning.pdf
EKON27-FrameworksTuning.pdfEKON27-FrameworksTuning.pdf
EKON27-FrameworksTuning.pdf
 
Midwest PHP - Scaling Magento
Midwest PHP - Scaling MagentoMidwest PHP - Scaling Magento
Midwest PHP - Scaling Magento
 
pps Matters
pps Matterspps Matters
pps Matters
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
 
IPv6 on the Interop Network
IPv6 on the Interop NetworkIPv6 on the Interop Network
IPv6 on the Interop Network
 
Training Slides: 205 - Installing and Configuring Tungsten Dashboard
Training Slides: 205 - Installing and Configuring Tungsten DashboardTraining Slides: 205 - Installing and Configuring Tungsten Dashboard
Training Slides: 205 - Installing and Configuring Tungsten Dashboard
 
Open stack ha design & deployment kilo
Open stack ha design & deployment   kiloOpen stack ha design & deployment   kilo
Open stack ha design & deployment kilo
 
Scalable Architecture 101
Scalable Architecture 101Scalable Architecture 101
Scalable Architecture 101
 
Balázs Bucsay - XFLTReaT: Building a Tunnel
Balázs Bucsay - XFLTReaT: Building a TunnelBalázs Bucsay - XFLTReaT: Building a Tunnel
Balázs Bucsay - XFLTReaT: Building a Tunnel
 
Scalable Web Apps
Scalable Web AppsScalable Web Apps
Scalable Web Apps
 
IPv6 Transition Considerations for ISPs
IPv6 Transition Considerations for ISPsIPv6 Transition Considerations for ISPs
IPv6 Transition Considerations for ISPs
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 Systems
 
IPVS for Docker Containers
IPVS for Docker ContainersIPVS for Docker Containers
IPVS for Docker Containers
 
[En] IPVS for Docker Containers
[En] IPVS for Docker Containers[En] IPVS for Docker Containers
[En] IPVS for Docker Containers
 

Recently uploaded

Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneCall girls in Ahmedabad High profile
 
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escorts
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our EscortsCall Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escorts
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escortsindian call girls near you
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneVIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneCall girls in Ahmedabad High profile
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663Call Girls Mumbai
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 

Recently uploaded (20)

Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
 
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escorts
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our EscortsCall Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escorts
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escorts
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneVIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 

Load Balancing

  • 1. High Availability Low Dollar Load Balancing Simon Karpen System Architect, VoiceThread skarpen@voicethread.com Via Karpen Internet Systems skarpen@karpeninternet.com These slides are licensed under the Creative Commons Attribution Share-Alike 3.0 license, http://creativecommons.org/licenses/by-sa/3.0/US/
  • 2. Overview • What is Load Balancing • Why load balance • What services should you load balance • What are some common load balancing topologies • What are some open source load balancing technologies • How would we build a HA configuration out of these technologies • How do I IPv6 enable IPv4 services with a single command line on a dual-stack machine
  • 3. What is Load Balancing • Split traffic across two or more servers • Many different techniques and topologies • Layer 4 or layer 7 • Useful for most TCP services • Divides traffic using a variety of algorithms (WLC, RR, etc)
  • 4. Why Load Balance • Improve performance • Improve redundancy • More cost effective scaling o 4-socket machines cost 4x as much as 2-socket • More cost effective redundancy o n+1 or n+2 instead of 2n • SSL Acceleration • Security / IPS / Choke Point
  • 5. Which Services • Without built-in failover • More than one infrastructure unit of performance • Good: web services, application services • Probably not: DNS, inbound SMTP • Examples: virtually any web site you visit! • Stickiness – understand your services
  • 6. Background - OSI Model • Layer 1: Physical (cable, electrical) • Layer 2: Datalink (example: Ethernet) • Layer 3: Network (example: IP) • Layer 4: Transport (example: TCP) • Layer 5: Session • Layer 6: Presentation • Layer 7: Application (example: HTTP)
  • 7. Topologies • Application Proxy • Half-NAT • Full-NAT • Direct Server Return
  • 9. Application Proxy • Positives o Simplest to setup o Minimal platform dependencies o Minimal changes to other infrastructure o 100% Userspace • Negatives o Limited total performance o Hides end user IPs from applications
  • 12. Half and Full NAT • Full NAT o Similar to an application proxy o Destination still doesn’t know source IP o All packets still go through the load balancer • Half NAT o Destination IP is changed, source IP is not o Allows the application to know the client o All packets still go through the load balancer
  • 14. Direct Server Return • Incoming packets pass through the load balancer • Outgoing direct to the gateway / client • Most scalable • Most complex to configure • Application servers must all have public application IP, non-ARP o via arptables, loopback, etc
  • 15. Apache mod_proxy_balancer • Application (layer 7) proxy for web • Runs under any cluster manager • Cookie based persistence • Apache rewrite, redirect, etc at the load balancer • Web (http, https) traffic only • SSL offload / SSL issues • Anything that runs Apache (even Windows)
  • 16. Apache mod_proxy_balancer <VirtualHost my.site.com:80> ServerName my.site.com ProxyPass / balancer://mysite/ lbmethod=byrequests ProxyPassReverse / balancer://mysite <Proxy balancer://mysite> BalancerMember http://10.0.0.1/ route=mysite1 BalancerMember http://10.0.0.2/ route=mysite2 </Proxy> ProxyPreserveHost On </VirtualHost>
  • 17. pen • Runs under any cluster manager • Simple layer 4 or layer 7 proxy • Very simple configuration • Moderate traffic • Really shines for internal services • Already IPv6 ready! • Linux, BSD, Solaris
  • 18. pen • Configuration via command line options • Use init scripts from web site, or roll your own • Init scripts store command line options in pen.cf pen –x 6144 –c 262144 –h –H –p <pidfile> 192.168.232.20:80 192.168.232.21:80 192.168.232.22:80 pen –x 500 –c 16384 –h –p <pidfile> 192.168.232.20:993 192.168.232.23:993 192.168.232.24:993
  • 19. IPVS / Pulse / Piranha • These work together as a system • IPVS: load balancing • Pulse: cluster manager (lightweight) • Piranha: web interface for configuration • EL5 version is IPv4 only • EL6 version is IPv4 / IPv6 • Layer 4, in-kernel, Linux only
  • 20. IPVS • IP Virtual Server, implemented via Netfilter • Controlled via ipvsadm • Or use a front-end like piranha • Supports persistence, many schedulers Command line: ipvsadm –A –t 192.168.23.20:80 –s rr ipvsadm –a –t 192.168.23.20:80 –r 192.168.23.21:80 –m Ipvsadm –a –t 192.168.23.20:80 –r 192.168.23.22:80 –m
  • 21. Piranha • Graphical configuration interface • Manage Pulse and IPVS configuration • Web based, some expensive LB use it too • Handles half-NAT, full-NAT and DSR topologies • Runs on port 3636, password protected • Recommend access via ssh tunnel
  • 22. Piranha - Pulse • Simple, single purpose cluster manager • Only supports 2-node active/passive failover • Configured via Piranha web interface
  • 23. Piranha - Pulse Enable the Backup Server for HA
  • 24. Piranha - Pulse Configure the Redundant IP, Sync options
  • 25. Piranha – Virtual Server Add a virtual server, then Edit its configuration Be sure to make all changes on BOTH hosts!
  • 27. Piranha – Real Servers Add two real servers, and prepare to edit
  • 28. Piranha – Real Server Configure both real servers on both hosts
  • 29. Piranha - Finalize • Configure monitoring scripts (write if needed) • Activate real servers • Activate virtual servers • Add non-ARP’d VIPs on actual real servers (if using DSR) • Start pulse (init script) on both servers • Test, verify, debug!
  • 30. Cluster Managers • LVS / IPVS fits well with Pulse • Pen and Apache are simple, run under virtually any cluster manager • Positive experience with Heartbeat • Choose based on organizational needs • (aka use what your team knows!) • Simple services, limited needs from CM
  • 31. Heartbeat, pen, Apache • Apache (on EL5/EL6) has good init scripts • Pen init scripts from web site need killall in stop section (otherwise it doesn’t work) • Run under Heartbeat v1 configuration as a service and an IP Address • Apache init scripts ready for Heartbeat v2 / Pacemaker / CRM • Pen init scripts will need a rewrite
  • 32. Minimal ha.cf • ucast eth1 192.168.232.10 • ucast eth1 192.168.232.11 • keepalive 2 • warntime 10 • deadtime 30 • initdead 120 • udpport 694 • auto_failback on • node lb0 • node lb1 • respawn hacluster /usr/lib64/heartbeat/ipfail
  • 33. V1 style haresources for Load Balancing lb0 192.168.232.20 pen httpd lb1
  • 34. IPv6! • Bootstrapping problem, you can help! • LVS / IPVS supports IPv6 in EL6 but not EL5 • Pen supports IPv6 out of the box • Apache mod_proxy supports IPv6 • Reports mixed on mod_proxy_balancer • Could use IPv6 mod_proxy in front of IPv4 mod_proxy_balancer
  • 35. Easy IPv6 • One command line, as promised! • Uses pen, mostly cross platform (Linux / Solaris / BSD) • Must run on a dual stack box • Application must be TCP, not UDP • Run under a cluster manager for HA pen <regular options> ipv6addr:svcport ipv4addr:svcport Now you can IPv6 enable your web site!
  • 36. Final Thoughts • Lots of options in terms of software and topology • This does not cover global load balancing • This can be layered with global LB or ADN • Balance performance, cost, complexity • Think about organizational and application needs