Forum Discussion

José_Ramón_Veci's avatar
José_Ramón_Veci
Icon for Nimbostratus rankNimbostratus
Feb 15, 2017

Problem with persistent connection in client side

I have configured a Virtual Server that attends requests of XML clients and based on a tag in the request, through an iRule, send the request to the corresponding pool.

when XML_CONTENT_BASED_ROUTING {

for {set i 0} {$i < $XML_count } {incr i} {

if {($XML_queries($i) contains "differential_tag")} { 
    pool Pool_1 
    }
else { 
    pool Pool_2 
    }  
  }

}

This works fine but I have to avoid persistent connections on the client side (keep alive) since it sets up the connection and the iRule seems to filter only the first request. I make requests containing the "differential_tag" and are sent to Pool_2

I have found a temporary solution by setting the value to 1 in Maximun Requests of the HTTP profile, or by configuring an iRule that closes the http connection after the response.

when HTTP_REQUEST { set method [HTTP::method] }

when HTTP_RESPONSE {

The current connection will close after a POST reply if { $method eq "POST" } { HTTP::close } }

From what I read HTTP::close and Maxium Requests = 1 they also close the TCP connection after each request. I am looking for a way to optimize this so that I can close the HTTP connection so that each request goes through the "pools" iRule but does not close the connection with the client.

Do you know any way to do it?

2 Replies

  • Are you using OneConnect ? OneConnect will force the F5 to make decisions for every HTTP request.

     

  • Thanks for your answer

     

    Yes, I have configured the default profile of OneConnect on the virtual server but if I remove the iRule or 1 in Maximun Requests the HTTP profile starts sending requests to the wrong pool