distributed load balancing
play

Distributed load balancing Real case example using open source on - PowerPoint PPT Presentation

Distributed load balancing Real case example using open source on commodity hardware Pavlos Parissis | LinuxConf Berlin 2016 Pavlos Parissis Senior UNIX System Administrator Global Traffic Distribution pavlos.parissis@booking.com The


  1. Distributed load balancing Real case example using open source on commodity hardware Pavlos Parissis | LinuxConf Berlin 2016

  2. Pavlos Parissis Senior UNIX System Administrator Global Traffic Distribution pavlos.parissis@booking.com

  3. The traditional way users ● Scales only vertically websiteA ● Single point of failure ● Choke point for (D)DOS ● Very expensive Standby Node Active Node

  4. A better way users websiteA

  5. How to get there ● Equal-Cost Multi-Pathing routing ● Anycast network address scheme ● Bird Internet Routing Daemon ● A healthchecker for Anycasted services ● HAProxy Layer4-7 load balancer

  6. Equal-Cost Multi-Pathing routing Destination IP Next hop 5.56.17.220/32 node1 5.56.17.220/32 node2 ECMP 5.56.17.220/32 node3 5.56.17.220/32 node4 1 2 3 4 ● Nodes are distributed across multiple networks ● Preserves source and destination addresses ● Cheapest form of balancing ● Load balancing at wire-speed ● Adding/removing a path reshuffles flows

  7. Equal-Cost Multi-Pathing users Tier 1 Load balancer Layer 3 Tier 2 Load balancer Layer 7 Layer 7 Layer 7

  8. 2-Tier setup in production users Layer 3 Layer 3 Layer 3 Fabric Layer Tier 1 Load balancer Layer 3 Layer 3 Layer 3 Layer 3 Layer 3 ToR Layer Layer 7 Layer 7 Layer 7 Layer 7 Layer 7 Tier 2 Load balancer Layer 7 Layer 7 Layer 7 Layer 7 Layer 7 Layer 7 Layer 7 Layer 7 Layer 7 Layer 7

  9. Benefits of 2-Tier setup ● Horizontally scalable ● Scaling and managing each tier independently ● Single device becomes less critical

  10. Anycast network address scheme receiver receiver A C sender receiver B distance in number of hops

  11. Anycast in production users Data-center A Data-center B LB platform transition time ~20ms LB platform local users local users

  12. Benefits of Anycast in production ● Network detect failures within 1.2secs ( BFD protocol helps a lot) ● Switches traffic to other location within 1sec ● Reduces network distance which lowers response time ● Provides a very fast and without manual intervention fail-over which improves service reliability ● Works for TCP protocol

  13. Dive into details ● Bird Internet Routing daemon ● A healthchecker for anycasted services ● HAProxy Layer4-7 load balancer

  14. How it works ToR Fabric Bird switch switch apps anycast check apps apps healthchecker HAProxy Load balancer node Users

  15. How Bird advertise routes BGP peer export routes BGP protocol 1.2.3.1/32 dev lo [direct1 2016-09-19] * (240) 1.2.3.2./32 dev lo [direct1 2016-09-19] * (240) direct protocol Bird daemon import routes Load balancer node: 10.1.1.1 loopback interface 1.2.3.1/32 1.2.3.2/32

  16. Filtering routes for unhealthy services BGP peer exported routes: 1.2.3.1/32 route BGP in LIST protocol filter LIST= [ 1.12.3.1/32 dev lo [direct1 2016-09-19] * (240) 1.2.3.1/32 1.12.3.2./32 dev lo [direct1 2016-09-19] * (240) ] direct import routes protocol anycast-healthchecker loopback interface 1.2.3.1/32 1.2.3.2/32 service

  17. HAProxy load balancer ● Highly configurable ● Rock solid ● Excellent support ● Supports Lua ● Faster than Nginx in our setup, benchmark yours

  18. HAProxy load balancer performance

  19. Software and Hardware we use ● Arista switches ● 2 x 10GbE interfaces on servers and 160GbE (4 x 40GbE) on switches ● Bird Internet Routing Daemon http://bird.network.cz ● HAProxy load balancer http://www.haproxy.org ● https://github.com/unixsurfer/anycast_healthchecker ● https://github.com/unixsurfer/haproxystats ● https://github.com/unixsurfer/haproxyadmin ● HP discrete/blade servers

  20. We are hiring Site Reliability Engineers https://workingatbooking.com

Recommend


More recommend