Forum Discussion

David_X_20743's avatar
David_X_20743
Icon for Nimbostratus rankNimbostratus
Jan 29, 2009

timer trigger event

Hi,

 

 

I am not sure if there is any timer trigger event has been implemented.

 

 

The case is we have customer, they want to use F5 to LB a primary pool between Server A and Server B. If both Server A and Server B failed. They want to wait up to 10 Minutes before F5 decided to switch to a backup pool.

 

 

It would be very easy to achieve if there is no waiting time there.

 

 

So I am wondering if there is timer event can be used in iRules at all to achieve that.

 

 

Any suggest would be really appeciated.

 

 

Thank you.

5 Replies

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    There is not currently a timer event within iRules, but it sounds like you should be able to accomplish pretty close to what you're looking for with just a normal VIP/Pool config and a very long interval period on a monitor. If you set a monitor with a very long poll interval on both of your systems, then you'd be able to determine if they've both been down for 10 minutes, then use a fallback host for a new pool. You'd likely only want to set the polling interval to 5 minutes, but that should get you close to what you're looking for.

     

     

    Colin
  • Hi Thanks for the reply. That is what I am currently doing at the moment. However the problems is if I setup the monitor timeout for 10 mintues. even the node down, the F5 will not take it out of pool before 10 minutes expired.

     

     

    So that some new request will be kept sending to the dead node and client will experience the website down

     

     

    If there would be any way to change that please?

     

     

    Thank you.
  • Hi

     

     

    Not sure if the following iRules will do it at all please

     

     

    when LB_FAILED {

     

    if { ( [active_members primarypool] == 0 ) and ([clock seconds] == 600]) } {

     

    pool backuppool

     

    }

     

    }
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    You could certainly do something that's a variation on that. There's no reason that I can see, given your current requirements, to wait for the LB_FAILED event. If we're going to manually check the active_members count of the pool we know is configured for the VIP anyway, we can do that in the HTTP_REQUEST.

     
     when CLIENT_ACCEPTED { 
       set loop 0 
     } 
      
     when HTTP_REQUEST { 
       if {[active_members primarypool] == 0} { 
         if { $loop == 0} { 
           set first [clock seconds] 
           set loop 1 
         } elseif { [expr [clock seconds] - $first] >= 600} { 
           pool backuppool 
         } 
       } 
     } 
     

    The problem with something like this is...what are you going to do with the requests coming in for that 10 minutes where all of the active members in your primary pool are down, but you don't want to send them to your backup pool yet? Are they just going to be rejected? Sent to the down servers? Discarded? Sent back a message from the LTM? That's the piece of this iRule that's still missing.

    As it sits right now they're going to be sent to whatever the VIP's default pool is (likely primarypool in this case) and if all of those members are down, they're going to use the fallback host, or just get a timeout if none is configured. That's probably not ideal.

    Let me know what it is you want to do with them and I'll help you get this updated to include that as well.

    Colin
  • Thank you for this. I think we probably would send a like message back from LTM.

     

     

    I have few question about this iRule, If any chance you could take a look, would be gratful

     

     

    When both of the nodes in primary pool failed

     

    'set first [clock seconds]

     

    set loop 1'

     

    Obviously these two lines will record the time of the first time entry and set the loop as 1, So that in the following event, it will go to caculate the time gap straight away.

     

    And after 10 Minutes, F5 will using backuppool.

     

     

    But once the backuppool start using, does it mean it matches the client_accepted event, and the loop will be set back to 0 again.

     

     

    So that in the future, it will have to wait another 10 minutes before F5 redirect another request to the backuppool in case of the primary pool failed?

     

     

    Thank you very much