RE: [load balancing] Can BigIP F5 consider an http 500 error or 404 error?

From: Rick Upton <rick [izzat]>
Date: Fri Aug 04 2006 - 20:18:28 EDT

Hi all,
  First I just want to say am overwhelmed by everyone's generosity; I have never received such quality and quantity of responses to an inquiry so quickly on any email list. This list newbie is truly grateful!
  I am not a load balancer techie, so I have forwarded all of your emails to the tech helping me. After receiving some of your emails, he responded as follows:
    After looking into the issue, I have found that the BigIP recognizes the 500 error as the site still being up because the web server is still responding. On new BigIP servers’ version 9.0 and above, (our east coast server is a BIG-IP unit with Kernel 4.5.10 Build84) one can do some programming and get it to recognize the 500 web page and setup a rule to enable it to go to the other server.
  Link to article on F5 site
  The load balancer is pointing to two Windows servers running the same .NET web service, but as mentioned before one is running Windows 2000 Server and the other is running Windows Server 2003.
  After receiving some more of your emails, I asked the tech to see if we can use a web request to check for a valid response instead of checking for certain errors, since checking for success would be a more foolproof way of trapping all errors, rather than trying to anticipate every possible error and writing code to trap each one.
  Please excuse me if my tech terms aren't exactly right; as I mentioned I'm a newbie to this.
  Best regards,
  Rick Upton
Wesley Robertson <> wrote:
        v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} st1\:*{behavior:url(#default#ieooui) } Hi,
  At the risk of beating a dead horse, I’d like to address the question in the original post of taking action when a server returns a 404. Monitors are great, good ones will eliminate 99% of your failed requests. However, if the server throws a 404, a monitor will not do anything for that request…it will be monitor_timeout_seconds before it marks the node DOWN, which will only affect new requests.
  So to take action in real time, you need an iRule; a v9.x iRule to be precise. You haven’t mentioned your HW platform or SW version, so I can’t say if this is useful for you or not. Anyhow, the iRule will need to parse the server response for the 404, then do something about it. You could have it retry, reselect, redirect, probably more I don’t know or haven’t thought of. DevCentral has many examples of how to approach this in the iRule v9.x forums, simply search for “404”. Here is a pretty good thread hashing it out:
  From: [] On Behalf Of Barrett, John
Sent: Friday, August 04, 2006 1:22 PM
Subject: RE: [load balancing] Can BigIP F5 consider an http 500 error or 404 error?

    yes, the BigIP does have the capacity of having a monitor programmed to take individual nodes out of service behind a VIP. Depending on your version of code, you can have an internal or external monitor (internal is letting the BigIP process do it, external is letting a script on the BigIP do the monitor and send a result code back to the BigIP process) See the info from Vince. The long and short answer of having an external to the device monitor an application and send something to the BigIP to take a node out of service is a tricky one. I believe that this is possible on some versions of code using an SNMP set or (I know this works) by ssh'ing into the box and performing a bigpipe command to take a node out of service in a pool. you can ssh using a script so it's transparent.




    -----Original Message-----
From: [] On Behalf Of Rick Upton
Sent: Friday, August 04, 2006 11:45 AM
Subject: Re: [load balancing] Can BigIP F5 consider an http 500 error or 404 error?
    Thanks to Vince and Julian for the quick responses and suggestions for using monitors, but I'm not sure if they address the issue. Is there a way for an external monitor to notify the load balancer to not route traffic to one of the web servers? Or does the BigIP F5 have a capability to be programmed with a monitor that can switch off traffic to one of the web services?


    I actually do have a Perl program running on a separate server which acts as a monitor by sending requests to each web service directly (not through the load balancer) to determine if each web service is returning expected results. When a web service returns unexpected results, my group gets paged.


    The problem is, between the time that the monitor detects a problem and the time we fix the problem (which can be a long time if no one in my small team is near a computer), the load balancer will continue to route traffic to the web service that is returning unexpected results.



I have monitors (like the one listed below) that will mark a node down when a page in the application doesn't work. The monitor looks for a keyword that will only show up on a properly generated page (ie: not an error condition).

monitor http-es {
   defaults from http
   interval 30
   timeout 11
   recv "User ID:"
   send "GET /es/Unifi/Console/UDS_Templates/login.jsp"

The other option would be to write an external monitor (using perl/libwww or something) that will check the status code. The monitor would be something like:

use LWP;

my $url = 'http://iappsaccp/sso/SplashScreen.jsp';
my $browser = LWP::UserAgent->new;
my $response = $browser->get( $url );

if ($response->status_line =~ /^40/) {
    print ("DOWN\n");
} elsif ($response->status_line =~ /^50/) {
    print ("DOWN\n");
} else {
    print ("UP\n");


          Rick Upton <>
Sent by:
    08/03/2006 07:23 PM
          Please respond to
Julian Grunnell <> wrote:
  Maybe a specific health monitor checking a page and receiving a specific string of text would do the trick? Give it a blast, see what happens.
  monitor my_http {
   defaults from http
   recv "SERVER-UP"
   send "GET /test.html"

    [load balancing] Can BigIP F5 consider an http 500 error or 404 error?

Is there a way to configure BigIP to consider a web service to be "down" if the web service generates a 404 or 500 error?
I'm a load balancing newbie. I have a web service running on two servers, and the web service is unreliable on both of them. When the web service fails, my browser gets a 404 error from the server running the Windows 2000 Server, or a 500 error from the server running Windows Server 2003. I have a BigIP F5 sitting in front of the two servers, but it appears that the BigIP F5 doesn't react when these errors are generated, which I assume is due the fact that an error is being returned (as opposed to nothing at all).
If the BigIP F5 can't do the job, is there anything else that can do the job (short of making the web services more reliable so that these errors don't occur)?
Best regards,
Rick Upton

The Load Balancing Mailing List
MRTG with SLB:
Hosted by:
Received on Fri Aug 4 20:18:32 2006

This archive was generated by hypermail 2.1.8 : Fri Aug 04 2006 - 20:30:23 EDT