For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

jma_44485's avatar
jma_44485
Icon for Nimbostratus rankNimbostratus
Oct 10, 2009

Irule question about Hash persistence

Hi,

 

I am really newbie of Irules. The issue I have is that the load is not balanced on our web servers. I have virtual server AAA in BigIP LTM. Hash_persistence profile is assigned to the virtual server AAA. Irule is assigned to the hash persistence profile. The Irule forwards http request to a pool "webpool" with round robin method. Two nodes are in that pool.

 

 

The irule is like following.

 

 

if { [HTTP::header host] eq "xxx.xxx.com" } {

 

pool webpool}

 

 

elseif { [HTTP::header host] eq "xxx.xxx.com" } {

 

pool webpool}

 

...

 

 

I have been trying to figure out why the load cannot be balanced in the webpool. I see the Irule "when HTTP_REQUEST { persist hash [HTTP::uri]}" posted on DevCentral, but I don't know how to use it in our environment. Can anyone shed some lights to me?

 

 

Many Thanks

19 Replies

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    I'd suggest just doing the following:

    Removing the hash persistence profile, add a cookie insert persistence profile and testing?

    If the persistence fails, you might need to hardcode the domain on the persistence cookie using an iRule like this. You'll need to update the persistence cookie name and the domain you want to set it with. Make sure to prepend a period to the beginning of the domain (ie .aaa.com, not aaa.com).

     
     when HTTP_RESPONSE { 
      
         Check if persistence cookie has a value 
        if {[HTTP::cookie "BIGipServerMy_pool_name"] ne ""}{ 
      
            Set domain on the persistence cookie 
           HTTP::cookie domain "BIGipServerMy_pool_name" ".aaa.com" 
        } 
     } 
     

    Aaron