Forum Discussion

andrey_k_112670's avatar
andrey_k_112670
Icon for Nimbostratus rankNimbostratus
Sep 22, 2006

iRule for HTTP per request balancing

Hello iRules Experts,

 

I'm very new to iRules, hope you may help me with clarification.

 

I'm a bit confused with the correct event triggers processing to perform the following task:

 

1. The Virtual Server is balancing SOAP requests to two nodes.

 

2. Usually it would be one persistant http/tcp session established from the client side.

 

3. SOAP request must be balanced based stricly on the SOAP body contents condition to the correct node.

 

 

Here is my first iRule, which does not work (drop the tcp session):

 

 

rule rp50_rule {

 

when CLIENT_ACCEPTED {

 

set NODE1 198.19.0.49

 

set NODE2 198.19.0.55

 

}

 

when HTTP_REQUEST {

 

if { [HTTP::payload[] matches_regex "380\d{8}[02468]@.*" } {

 

pool radius5016_pool member $NODE1 8081

 

log local0. "sending rp50 to: $NODE1"

 

}

 

else {

 

pool radius5016_pool member $NODE2 8081

 

log local0. "sending rp50 to: $NODE2"

 

}

 

}

 

}

 

 

virtual rp50_vs {

 

destination 10.2.97.229:8081

 

ip protocol tcp

 

profile http tcp

 

pool radius5016_pool

 

rule rp50_rule

 

vlans external_mobile enable

 

}

 

 

pool radius5016_pool {

 

monitor all gateway_icmp

 

member 198.18.0.49:any

 

member 198.18.0.55:any

 

}

 

 

AFAIU, the pool is per connection balanced. What events should I intercept and force the BIGIP to establish two tcp sessions?

 

 

thank you,

 

- andrey

2 Replies

  • If you just want to load balance per HTTP Request instead of the default per TCP connection, use OneConnect with /32 netmask.

     

    Avoid using regex within iRule as it tends to consume more resources in the F5.