Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Switching from HAProxy to Samaritan

Switching from HAProxy to Samaritan

Tevin Zhang

July 14, 2016
Tweet

More Decks by Tevin Zhang

Other Decks in Technology

Transcript

  1. Server-side load balancing LB C Service A Service A Service

    C Service A Service A Service D LB D Service A:1 Service A:2 Service B:1 Service B:2 Service A:3 Service B:3
  2. Server-side load balancing LB C Service A Service A Service

    C Service A Service A Service D LB D Service A:1 Service A:2 Service B:1 Service B:2 Service A:3 Service B:3 LB C LB D
  3. Server-side load balancing LB C Service A Service A Service

    C Service A Service A Service D LB D Service A:1 Service A:2 Service B:1 Service B:2 Service A:3 Service B:3 LB C LB D 1. Single point of failure 2. Performance bottleneck
  4. Server-side load balancing LB C Service A Service A Service

    C Service A Service A Service D LB D Service A:1 Service A:2 Service B:1 Service B:2 Service A:3 Service B:3 LB C LB D LB C LB C LB C LB C LB C LB D
  5. Server-side load balancing LB C Service A Service A Service

    C Service A Service A Service D LB D Service A:1 Service A:2 Service B:1 Service B:2 Service A:3 Service B:3 LB C LB D LB C LB C LB C LB C LB C LB D 1. Single point of failure 2. Performance bottleneck 3. Hardware cost 4. Hard to deploy & maintain
  6. Client-side load balancing Service A LB A Service B LB

    B Service A Service A Service C Service A Service A Service D LB C Service A Service A Service C Service A Service A Service D LB D Service A:1 Service A:2 Service B:1 Service B:2 Service A:3 Service B:3 LB C LB D LB C LB C LB C LB C LB C LB D
  7. Sam HAProxy Client Server Server Server Configuration File Sam Client

    ZooKeeper Dog Conf Monitor Server Server Server Sash Monitor Generate
  8. HAProxy as client-side LB Service X Client Node A Node

    B Client 1. Node A 2. Node B HAProxy HAProxy Configuration File 1. Node A 2. Node B
  9. Scale-out with HAProxy Service X Client Node A Node B

    Client 1. Node A 2. Node B HAProxy HAProxy Configuration File 1. Node A 2. Node B Node C 3. Node C 3. Node C Scale-in is similar
  10. Scale-out with HAProxy Service X Client Node A Node B

    Client 1. Node A 2. Node B HAProxy HAProxy Configuration File 1. Node A 2. Node B Node C 3. Node C 3. Node C Scale-in is similar O(n)
  11. Sam as client-side LB Service X Client Node A Node

    B Client Sam Sam ZooKeeper Register Pull
  12. Scale-out with Sam Service X Client Node A Node B

    Client Node C Sam Sam ZooKeeper Register Pull ZooKeeper Scale-in is similar
  13. Scale-out with Sam Service X Client Node A Node B

    Client Node C Sam Sam ZooKeeper Register Pull ZooKeeper Scale-in is similar O(1)
  14. Features • Zero client-side configuration • Hot re-configuration without down

    time • Auto failure detection, handling and recovery • Provide metrics for individual backend service • Single process