Forum Discussion

Paul_E__144936's avatar
Paul_E__144936
Icon for Nimbostratus rankNimbostratus
Feb 20, 2014
Solved

Connection Draining based upon Health Monitoring?

I have an application that has a special URL which returns the server's health state, and I'm working with our load balancing team, who is configuring the F5 for me, and they are having trouble with the Maintenance aspect.

 

The server URL returns the following values:

 

  • If the server is healthy and available for new requests, it returns 'PASS'.
  • If the server is in Maintenance mode (still up, but should not be sent new requests), the URL returns 'MAINTENANCE'.
  • If the server is down, it returns various error messages, like 'FAIL' or 500, etc.

What I would like is for the F5 to recognize the server URL's "MAINTENANCE" response as a special condition that allows persistent connections to drain normally, and just not send any new connections to that server.

 

We tried setting the 'Action On Service Down' to None, which somewhat allowed the existing connections to drain in Maintenance mode, but the same behavior continued when the server physically went down (then users got error messages).

 

Alternatively, other settings kill the node promptly when the server really is down, but also kill it for the 'MAINTENANCE' response too.

 

Is there any way we can customize the logic to achieve the desired behavior, perhaps with an iRule?

 

Apologies for not knowing much about F5 load balancing...

 

Appreciate any help.

 

Thanks, Paul

 

  • There is an option called "recv disable" string which if received will disable the member.

     

    From the monitor configuration monitor monwebserver { defaults from https recv disable "MAINTENANCE" recv "PASS" send "GET / HTTP/1.1\r\nHost: abc.com\r\nConnection: close\r\n\r\n } This will disable the member if MAINTENANCE is received and will enable it if PASS is received. when its disabled it will allow existing connections.

     

6 Replies

  • There is an option called "recv disable" string which if received will disable the member.

     

    From the monitor configuration monitor monwebserver { defaults from https recv disable "MAINTENANCE" recv "PASS" send "GET / HTTP/1.1\r\nHost: abc.com\r\nConnection: close\r\n\r\n } This will disable the member if MAINTENANCE is received and will enable it if PASS is received. when its disabled it will allow existing connections.

     

    • Paul_E__144936's avatar
      Paul_E__144936
      Icon for Nimbostratus rankNimbostratus
      Thank you for the quick response Mui! I will work with our admin tomorrow and see if we can get it going. If I may ask, is that a typo or two in your response? There's a double-quote before GET, but not one anywhere after. And you wrote "monitor configuration monitor monwebserver" which seems redundant to this newgry. Sorry, I've never seen this stuff before, so I can't tell for sure if the syntax is correct.
    • Paul_E__144936's avatar
      Paul_E__144936
      Icon for Nimbostratus rankNimbostratus
      I did a bit of reading, and I think I now understand your answer. "monitor configuration" is where this code goes. The monwebserver is just a name for the monitor, whatever we want. There is a missing quote, which I think goes at the end of the send statement. And I need to replace abc.com with the URL. Applying all that, here's my adjusted code. Does this look right? In my sample code below, the URL being monitored is: https://glcictkdap108.glr.local:11443/HealthCheck.dll/Check monitor HealthCheck { defaults from https recv disable "MAINTENANCE" recv "PASS" send "GET / HTTP/1.1\r\nHost: glcictkdap108.glr.local:11443/HealthCheck.dll/Check\r\nConnection: close\r\n\r\n" } Thanks again for your help!
    • Paul_E__144936's avatar
      Paul_E__144936
      Icon for Nimbostratus rankNimbostratus
      Mui, I've gone ahead and flagged this as the correct answer, even though we were not able to implement it. I appreciate your prompt and accurate answer. Our admin checked and said the 'recv disable' feature is not available until version 10.2. We are currently on 10.0, and apparently no upgrade is planned for our enterprise anytime soon.
    • Paul_E__144936's avatar
      Paul_E__144936
      Icon for Nimbostratus rankNimbostratus
      Thanks again. I think I just found a mistake in my send statement. I put the full path in the Host, instead of just the Host name. Here's a corrected statement. Am I using the correct notation for the port number, or is there a different way I need to specify it? send "GET /HealthCheck.dll/Check HTTP/1.1\r\nHost: glcictkdap108.glr.local:11443\r\nConnection: close\r\n\r\n" which would interpret as: "GET /HealthCheck.dll/Check HTTP/1.1 Host: glcictkdap108.glr.local:11443 Connection: close "