Forum Discussion

Ben_Nichols_107's avatar
Ben_Nichols_107
Icon for Nimbostratus rankNimbostratus
Nov 10, 2006

Check server http resposne and reselect if error, for vhosting

Hi,

 

 

I have been recommended to try and find the answer to my problem here.

 

 

We have 2 IIS web servers serving upwards of 200 sites. These sites regularly change. The client wants to occasionally stop a web site on one server and have the traffic fail over to the second. I am aware that this can be achieved with multiple pools and monitors with an iRule selecting the appropriate pool. However, I really want to avoid this as we do not want to have to change the config of the BIG-IPs every time a site is added or removed, ie. I want just 1 virtual server, 1 pool and 2 nodes.

 

 

I have noticed that without any monitors the BIG-IP will failover when a site is stopped, however the client sees several 500 errors before the BIG-IP switches over. This also happens to new sessions, there is a random chance of hitting the bad server with the first request, after that the BIG-IP switches to the good server.

 

 

I have been told that there is an iRule that on an incoming request could check that the response was valid and if it fails, reselect and request. That way a client would never see a bad server response (assuming there was at least one good server for that given site up).

 

 

Does that make sense?

 

 

Any help would be most appreciated. BTW I am new to iRules.

 

 

Many Thanks,

 

Ben

2 Replies

  • Hello,

     

     

    In general, I think you could use a rule to round robin requests to two different nodes. If the load balancing failed or a bad HTTP response code was detected, you could switch to the new node. You would probably want to use a counter to prevent an endless reselect if both nodes are down. After a certain count is reached, you could redirect to an external URL.

     

     

    Does your application require persistence? ie, does the app create a session that only exists on one server?

     

     

    Do both web servers host identical content?

     

     

    Would your client typically be disabling a single vhost to perform maintenance or disabling the web server altogether?

     

     

    Aaron
  • Hi,

     

     

    Thanks for the interest. What you are proposing sounds exactly right.

     

     

    Session state is not important since it is stored on a central server. All web servers will be identical.

     

     

    The admin will want to disable a single vhost for maintenance, there will obviously also be times when it is necessary to take a server offline as well.

     

     

    Thanks in advance,

     

     

    Ben