Forum Discussion

Phil_53695's avatar
Phil_53695
Icon for Nimbostratus rankNimbostratus
Dec 01, 2011

irule with uri to another pool might have issues.

when HTTP_REQUEST {

 

if { [string tolower [HTTP::uri]] contains "svn"} {

 

pool tfs_net_8081_pool

 

}

 

}

 

 

I have a single VIP and have 2 pools, both use the same IIS servers and have port 8080 and 8081 listening.

 

The goal was when the svn is inputted then it sends it to the 8081 pool. What I am seeing quite a bit is 404 intermittent errors. The application people say it works fine without the LTM if they go straight to the nodes, so I've trying to see if somehow my irule is not up to par. They insist on using a single VIP. So I thought I would post my irule to see if one of the experts saw anything wrong with it, or improve it.

 

 

Thanks

 

 

  • Hi Phil,

    Try this and watch your /var/log/ltm log when it is running to see what is going on inside the iRule and which parts are throwing the 404's.

    
    when HTTP_REQUEST {
    if { [string tolower [HTTP::uri]] contains "svn" } {
    log local0. "Client [IP::client_addr]:[TCP::client_port] - URI Contains SVN: [HTTP::uri]"
    pool tfs_net_8081_pool 
    }
    else {
    log local0. "Client [IP::client_addr]:[TCP::client_port] - URI does not contain SVN: [HTTP::uri]"
    pool other_pool_to_8080
    }
    }
    when HTTP_RESPONSE {
    if { [HTTP::status] == 404 } {
    log local0. "Client [IP::client_addr]:[TCP::client_port] gets a [HTTP::status]"
    }
    }
    

    What will happen in your logs is this:

    Dec 1 14:54:40 local/tmm info tmm[4932]: Rule Z.iRule.Development : Client 10.10.10.10:6088 - URI does not contain SVN: /favicon.ico

    Dec 1 14:54:40 local/tmm info tmm[4932]: Rule Z.iRule.Development : Client 10.10.10.10:6088 gets a 404

    To explain a little more....most browsers will open numerous connections up (usually 5 or so) to get different pieces of content from the server at the same time to speed up the browsing experience. This will help you narrow down (note that this is NOT 100% matching 1 to 1, but it is usually close enough that you can tell within the context of the event) which request failed by matching the Client IP Address and Target Port.

    Logging within an iRule is generally the fastest way to figure out what is going on.

    Hope this helps.
  • Hi,

     

     

    The logging helped me quite a bit. Now I have to determine if my irule is causing the issue or the node in the pool.

     

    I was seeing ton's of 404's until all connections were bled off the one node and then it stopped.

     

    So either the one node is not working correctly or they way we split off to 8080 & 8081 by using the irule is the issue.