Load Balancers


load balancer can be deployed to distribute client requests across server nodes in a farm or pool.

  • NIC teaming allows load balancing at the component level
  • can use a load balancer in any situation where you have multiple servers providing the same function
    • E.g., web servers, email servers, web conferencing servers, and streaming media servers
  • placed in front of the server network
    • distributes requests from the client network or Internet to the application servers
  • service address is advertised to clients as a virtual server
  • used to provision:
    • high availability services that can scale from light to heavy loads
    • fault tolerant services
    • provide mitigation against denial of service attacks

Two Types of Load Balancers

  • Layer 4 switch
    • basic load balancers make forwarding decisions on IP address and TCP/UDP header values
    • works at the Transport layer of OSI model
  • Layer 7 switch (content switch)
    • makes forwarding decisions based on application-level data
      • a request for a particular URL or data types like video or audio streaming
    • requires more complex logic

Info

  • appliances can perform switch-like forwarding at layer 3, 4, and 7
  • collectively referred to as multilayer switches

Scheduling

The scheduling algorithm is the code and metrics that determine which node is selected for processing each incoming request.

  • simplest type is called round robin
    • means picking the next node
  • Other methods include
    • picking the node with the fewest connections
    • or the best response time
  • Each method can be weighted using
    • administrator-set preferences
    • dynamic load information
    • or both
  • uses some type of heartbeat or health check probe
    • to verify whether each node is available and under load or not
    • Layer 4 load balancers can only make basic connectivity tests
    • layer 7 appliances can test the application’s state and verify host availability

Source IP Affinity and Session Persistence

Source IP or session affinity is a scheduling approach used by load balancers to route traffic to devices that have already established connections with the client in question.

  • layer 4 approach to handling user sessions
  • when a client establishes a session, it becomes stuck to the node that first accepted the request
  • application-layer load balancer uses persistence to keep a client connected to a session
    • configuration option that enables a client to maintain a connection with a load-balanced server over the duration of the session
    • aka sticky sessions
    • works by setting a cookie either on the node or injected by the load balancer
    • can be more reliable than source IP affinity
      • but requires the browser to accept the cookie