Forum Discussion

Osama_Friejeh_6's avatar
Osama_Friejeh_6
Historic F5 Account
Oct 05, 2008

Application layer persistence iRule

A customer of mine has a persistence requirement between his web servers and application server layer. BIG-IP is load balancing two layers: web layer and application layer. Persistence at web layer is performed by using cookie persistence. the traffic between the web servers and app servers is TCP. Due to an application limitation, we have to persist web server to a specific app server all the time:

 

- web1 persist to app1

 

- web2 persist to app2

 

- if app2 fails, web2 requests will be sent to app1. But if app2 comes back again, we want to change the persistence for new connections back to app2.

 

 

I tried with source address persistence but that cannot guarantee which web server is persisted to which app server.

 

 

I think an iRule is needed to achieve this requirement. can anybody help with a sample iRule?

 

 

5 Replies

  • Hi,

     

     

    you can try following steps.

     

     

    1. create 2 pools, app1_pool(app1 higher priority) and app2_pool(app2 higher priority).

     

     

    2. create this irule:- (assuming web1 ip address is 192.168.1.1)

     

     

    when CLIENT_ACCEPTED {

     

    if { [IP::addr [IP::remote_addr] equals 192.168.1.1] } {

     

    pool app1_pool

     

    } else {

     

    pool app2_pool

     

    }

     

    }

     

     

    3. assign this irule to app_virtual_server.

     

     

     

    hope this work for you.

     

     

    regards,

     

  • Osama_Friejeh_6's avatar
    Osama_Friejeh_6
    Historic F5 Account
    what would the persistence behavior be in this case?

     

    should I define the two members (app1 and app2) in each of the pools?

     

     

    what I understand from this Irule is this:

     

     

    if connection is coming from web1, send it to app1_pool (which has two members app1 and app2 where app1 has a higher priority). else if it is coming from web2 send the connection to app2_pool where app2 server has a higher priority. off course if pool members app1 or app2 are down by monitor, it will select the second member.

     

     

    there should not be any need for a persistence profile in this case.right?
  • Hi,

     

     

    You're right. you don't need any persistence method for this case. Since each of the server will connect to dedicated app server.

     

     

    regards,
    • Ecesureshkumar's avatar
      Ecesureshkumar
      Icon for Nimbostratus rankNimbostratus
      Would please suggest solution for my below request. if Web server 1 fails, all the load will forwarded to web server 2 and entire load will handled by App 2 only. Any solution to overcome this?
  • Hi team, here we have challenge in load sharing if Web server 1 fails, all the load will forwarded to web server 2 entire load will handled by App 2 only.

     

    is there any solution to overcome this?