Load Balancers Menu

Brocade ADX - Persistence
VendorBrocade
PlatformADX
Version12.3
Wednesday, 25 January 2012 00:00

There are 3 main types of persistence methods available on the Brocade ADX ; sticky, track and cookie. Belows explains each one whilst also supplying configuration examples.

Types

Sticky - Traffic is sent to the same server based on the clients IP for duration of the sticky timeout duration.
Track Port - A group of ports are defined. One of the ports is defined as a primary port. If a connection is initiated to the the primary port and then any further connections to any of the other ports within the group, persistence is applied. However if a connection is destined to a non-primary port(s) no persistence is applied.
Track Group - A group of ports are defined. If a connection goes to either of these ports then persistence is applied. This is typically used when SSL termination is used and traffic is sent to a different backend port.
Cookie Insert - A cookie is inserted into the HTTP header. The cookie is then used for persistence.
Cookie Passive - A cookie is inserted by the server. The cookie is then used to balance traffic for the remainder of the session to the same server.
Cookie Hashing - A cookie is generated on the server. The ADX generates a hash of this cookie and balances traffic based upon the cookies hash value.

Sticky

Here persistence (on a per client IP basis) is applied to port 80.

server virtual VIP1 192.168.1.3
  port sticky 80

Track Port

The track command is configured using the following construct 'track <primary-port> <port>'. Within this example if traffic is sent to the primary port (80) and any further connections to the other ports within the group (port 23 and 69) then connections are sent to the same server. If any connections are destined for any port that is not defined as the primary port no persistence is applied.

server virtual VIP1 192.168.1.3
  port sticky 80
  port sticky 69
  port sticky 23
  track 80 23 69

Track Group

Within this example traffic destined for either port 80, 69 and 23 is distributed to the same server.

server virtual VIP1 192.168.1.3
  port 80
  port 69
  port 23
  track-group 80 69 23

Cookie Insert

Within this example cookie persistence is achieved by injecting a cookie (containing the server ID). The value of this cookie is then used to maintain persistence to the necessary server.

csw-rule "r1" header "cookie" search "ServerID="

csw-policy "p1"
    match "r1" persist offset 0 length 4 group-or-server-id
    default forward 1
    default rewrite insert-cookie "ServerID"

server real RS1 10.1.1.1
    port http
    port http url "HEAD /"
    port http server-id 1211
    port http group-id 1 1

server real RS2 10.1.1.2
    port http
    port http url "HEAD /"
    port http server-id 1212
    port http group-id 1 1

server virtual VIP1 192.168.1.3
    port http
    port http csw-policy "p1"
    port http csw
    bind http RS1 http RS2 http

Cookie Passive

Within the following example the string "ServerID=" is searched for within the header 'cookie'. The value following this string is then used to balance the traffic.

csw-rule "r1" header "cookie" search "ServerID="

csw-policy "p1"
    match "r1" persist offset 0 length 4 group-or-server-id
    default forward 1

server real RS1 10.1.1.1
    port http
    port http url "HEAD /"
    port http server-id 1211
    port http group-id 1 1

server real RS2 10.1.1.2
    port http
    port http url "HEAD /"
    port http server-id 1212
    port http group-id 1 1

server virtual VIP1 192.168.1.3
    port http
    port http csw-policy "p1"
    port http csw
    bind http RS1 http RS2 http

Cookie Hashing

Within the following example the string "JSessionID=" is searched for within the header 'cookie'. The value following this string is then hashed and used to balance the traffic.

csw-rule r1 header cookie pattern “JSessionID=”

csw-policy p1
    match r1 persist offset 0 length 16 persist-to-hash-bucket
    default forward 1
   
server real RS1 10.1.1.1
    port 80
    port 80 group-id 1 1

server real RS2 10.1.1.2
    port 80
    port 80 group-id 1 1

server virtual VIP1 192.168.1.3
    port http
    port http csw-policy p1
    port http csw
    bind http RS1 80 RS2 80



 
We have 40 guests online