Forum Discussion

Paul_73795's avatar
Paul_73795
Icon for Nimbostratus rankNimbostratus
Jan 06, 2011

HTTP forward to Pool not working as expected

Hi, I am attempting to set up an iRule that forwards requests to our pool of sorry servers when there are no active members in the load balanced server pool.

 

 

As you can see by the logs if no active members are in the load balanced pool it redirects to the sorry server pool we get SERVER CONNECTED and displays the outage page. If I then turn bring the servers back online and refresh the browser the iRule looks to be doing the correct thing by directing the traffic to the load balanced server pool but in actual fact it is still being directed to the sorry servers and there is no SERVER CONNECTED response.

 

 

Have I done something incorrectly?

 

 

iRule

 

when HTTP_REQUEST {

 

set DEBUG 1

 

if { [active_members [LB::server pool]] < 1 } {

 

if { $DEBUG } { log local0. "[IP::client_addr]:[TCP::client_port]: using sorry server Pool: [LB::server]" }

 

pool pool_http_sorry_server

 

} else {

 

if { $DEBUG } { log local0. "[IP::client_addr]:[TCP::client_port]: using server Pool: [LB::server]" }

 

pool [LB::server pool]

 

}

 

}

 

when SERVER_CONNECTED {

 

Debug logging only. Remove this event once done testing

 

log local0. "[IP::client_addr]:[TCP::client_port]: server: [LB::server], [IP::server_addr]:[TCP::server_port]"

 

}

 

 

/var/log/ltm

 

Jan 6 18:28:58 local/tmm3 info tmm3[21819]: Rule irule_forward_outage_pool : 10.133.27.10:50651: using sorry server Pool: pool_http_bbdev 0

 

Jan 6 18:28:58 local/tmm3 info tmm3[21819]: Rule irule_forward_outage_pool : 10.133.27.10:50651: server: pool_http_sorry_server 203.2.32.66 80, 203.2.32.66:80

 

Jan 6 18:29:26 local/tmm3 info tmm3[21819]: Rule irule_forward_outage_pool : 10.133.27.10:50651: using server Pool: pool_http_bbdev 0

 

Jan 6 18:29:26 local/tmm3 info tmm3[21819]: Rule irule_forward_outage_pool : 10.133.27.10:50651: using server Pool: pool_http_bbdev 0

 

 

17 Replies

  • In situation 3, the logs are saying we're getting sent to the proper pool, but you're saying the content is coming from the sorry pool?!
  • Correct. This is what is confusing. I would expect to see a new connection to the default server to be made but this isn't occurring. This is where I thought the 'persist none' command would help.

     

  • Posted By Paul on 01/11/2011 02:59 PM

     

    Correct. This is what is confusing. I would expect to see a new connection to the default server to be made but this isn't occurring. This is where I thought the 'persist none' command would help.

     

     

    Since you're using OneConnect, you're going to re-use connections between the LTM and Pool Members. Still though, it would (should) be the correct pool.
  • Yes I agree that it should be using the default pool.

     

     

    To confirm what we are seeing I set up four separate terminals running tcpdump. Two terminals for the default pool and two for the sorry server pool of servers.

     

     

    I could see quite definitively that when performing action 3 from above "Clearing browser cache, active members in default pool" that http:requests are being sent on the F5 but none of the servers are being hit???? Does the F5 cache information?

     

  • If you put a space between the open angle bracket and the next letter, the forum code won't strip out the iRule event names from the ltm log file:

     

     

    < example>

     

     

    You could add logging to the iRule in the SERVER_CONNECTED event to see when a new serverside connection is opened and to which pool [LB::server], server IP [IP::server_addr] and port [TCP::server_port].

     

     

    You could also check to see if caching is enabled in the HTTP profile enabled on the virtual server.

     

     

    Aaron
  • The description for CACHE::disable says it's only being disabled for that request so I assume you're using it properly.

    Hoolio brought up a good point about persistence.
    Also, if you set persist to none for one case, you should explicitly set persistence in the other case. This is because the persist command takes effect for the duration of the connection.

    So, as part of your else statement, it might be wise to define it unless you don't need persistence within the pool_http_bbdev pool.
  • I noted what Hoolio said about setting persistence in the other part of the if statement. How do you go about setting it back or re-enabling it to use the persistence profile of the Virtual Server.

     

     

    What impact would there be if I remove the "persist none" from the sorry server case. I have tested this scenario and it looks to be working fine. But from a persistence point of view I wonder if it will cause problems?