r4 - 01 Dec 2008 - 13:19:37 - BeckyHYou are here: Wiki >  AppLogic24 Web > CatSwitchesL3LBCid
ALERT! AppLogic 2.4 Documentation The latest production release is AppLogic 3.0.30

L3LB - TCP Load Balancer - Implementation

Base Class

The LUX5 appliance image is used as the base class for L3LB appliance.

Class Volumes

No disk resizing is needed, the L3LB is using the defaults defined for the base LUX5 class.

Contents of the L3LB directory

L3LB software is installed under the /appliance subtree.

  • /appliance/ctl directory contains the sources necessary for L3LB web control interface, and is exported on the ctl interface for web access.
  • appliance.sh is the main L3LB startup script. Upon startup, it verifies the properties defined for the instance, creates a haproxy.cfg config file, launches haproxy-1.2.18, thttpd and feed_statistics.pl.
  • haproxy-1.2.18 is the HAProxy 1.2.18 binary.
  • thttpd is the thttpd version 2.25b binary. It is used for serving the ctl terminal.
  • feed_statistics.pl script extracts runtime statistics from the L3LB and feeds it to the MON.
  • haproxy.cfg is the HAProxy configuration file, created by appliance.sh script.
  • haproxy_restart.pl is the script that tracks modifications in haproxy.cfg file, done by health checker or by user through the ctl terminal, and restarts the HAProxy if necessary.
  • php-thttpd thttpd binary used to serve the ui terminal.
  • php-httpd.conf config file for php-thttpd binary.
  • udp_healthchecker.pl health check script for udp mode of operation.

Packages

No additional packages are required for L3LB.

Contents of the release directory:

Exported appliance image:

  • L3LB-21-1.0.0.tar.bz2 - L3LB for AppLogic 2.1
  • L3LB-24-1.0.0.tar.bz2 - L3LB for AppLogic 2.4

Sources:

  • haproxy-1.2.18.tar.bz2

Tests (see the test plan CatSwitchesL3LBTp and the release notes CatSwitchesL3LBRelNotes):

  • l3lb-21-test.1.0.0.tar.bz2 - test scripts for AppLogic 2.1
  • l3lb-24-test.1.0.0.tar.bz2 - test scripts for AppLogic 2.4

Theory of Operation

L3LB utilizes a single background service - the HAProxy TCP/HTTP load balancer (http://haproxy.1wt.eu). For the purpose of tcp load balancing, only the TCP mode of operation is enabled.

A number of 'listeners' and 'backends' are defined in the haproxy.cfg config file, which is created by the appliance.sh script upon appliance start, using the configured property values. One 'listener' is created for the in terminal, and is used for all incoming network traffic that needs to be load balanced. Another listener is created on the ui interface for the purpose of exporting the statistics GUI to the user. An additional listener is created on the internal loopback interface lo0 for the purpose of extracting the runtime statistics and reporting them through the mon terminal. Every connected outX terminal is defined as a backend where incoming traffic may be forwarded.

The listener on the in terminal receives an HTTP request and depending on the mode of operation, modifies the cookie in the passive, insert and synch modes. The request is then forwarded to one of the backend servers. If there is an existing session for this request, it is forwarded to the same backend server for all previous requests. If there is no existing session for this request, the backend server is selected by round-robin. The response from the server is again possibly modified and forwarded back to the client.

Configuration

The configuration file for HAProxy is generated at startup by the appliance.sh init script. It uses the properties defined in /etc/applogic.sh and uses them to create an /appliance/haproxy.cfg config file. A number of additional properties that are calculated at start time are written into the config file (ulimit-n, nbproc, bind address).

Log Files

The request logging is disabled in L3LB, only critical errors are reported into the system log (other then this, there is no logging).

 
Copyright © CA 2005-2011. All Rights Reserved.
%