Forum Discussion

rluyster's avatar
rluyster
Icon for Nimbostratus rankNimbostratus
May 05, 2008

struggling with "action on service down"

We are running an appliction that is load-balanced over 2 servers. The problem that I am having is that due to the nature of this application, if one of the servers fails, it is impossible for them to move to the other server.

 

 

My thought was if a server drops from the pool, to redirect the users to a URL that would tell them of the problem, and inform them that they will need to restart the application.

 

 

My assumption is that I can make this happen with an i-rule and using LB_FAILED.

 

 

My first question is does this make sense, and the second question would be, which option would I use for the "action on service down".

 

 

Thanks

 

Rick

3 Replies

  • Hi,

     

     

    Yes, you can force a Redirection, or even make a response telling your users about the issue. But you should know about the LB_FAILED event, since it will never be triggered if the real server has been marked down by a monitor. LB_FAILED only triggers when nobody is avalilable to handle your request:

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/LB_FAILED.html

     

    It's the same thing with "action on service down".

     

     

    What you should try to do is this: keep your user's session information (for instance, in the persistence table, with a lookup on the persistence table) and check the availability of its pool member before forwarding the request. You can do it with the lb:status commands.

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/LB__status.html

     

     

    Regards.
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Great suggestion, mgabaldon, to use persistence data with the LB::status command. For HTTP, you'd probably want to do that test for each request by leveraging the HTTP_REQUEST event.

     

     

    If you're going to implement the iRule approach, Rick, to answer your question 2, you'd want to set Action on Service Down to "None" so it doesn't interfere with the iRule response.

     

     

    We used this post for the DC Post of the Week this week and discussed a number of other relevant details, so I'll post back with the link when it's published.

     

     

    ciao

     

    /deb
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    One clarification, though:LB_FAILED only triggers when nobody is avalilable to handle your request. (link) It's the same thing with "action on service down". The purpose of the Action on Service option is to affect handling of connections in progress when a server goes down. See this tech tip for more: LTM: Action on Service Down (Click here)

     

     

    /deb