Forum Discussion

Mike_Cronquist_'s avatar
Mike_Cronquist_
Icon for Nimbostratus rankNimbostratus
Oct 07, 2013

Default pool question

If I do not define a "default" pool in the irule, my assumption is that it should default to the pool defined under the properties of the VIP? We are using BIG-IP 11.2.1 Build 1196.0 Hotfix HF7 of LTM.

 

3 Replies

  • If you don't specify a pool with the "pool" command, or do a direct assignment with the "node" command, it will default to the "default" pool you have configured in your virtual server configuration. The commands in the iRule are meant to override the default configuration.

     

    -Joe

     

  • I have a simpe irule that looks like: when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] {

     

    /images* { pool pool_images } } } I also have the default pool configured on the vip to be: pool_website

     

    If I navigate to: http://website.org/ it is trying to fullfil this request from the pool pool_images.

     

    If I change the irule and specify "default pool pool_website" it works correctly. when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] {

     

    /images* { pool pool_images } default { DEFAULT POOL pool pool_website } } } Are there other factors that I should be considering? Is this behavior correct?

     

    Thanks.

     

  • What you're most likely seeing is (TCP) session-based persistence. In lieu of any defined direction, a node will be persisted to within a single TCP session once a load balancing decision has been made. So if you have logic that sends traffic to a specific pool based on a URI, but do not have logic for requests that do not contain that URI, it's very likely that TCP persistence will send the next request to the same node. There are generally three ways to overcome this behavior:

    1. Be explicit in your iRules for every possible URI path and pool assignment (as you've witnessed).

    2. Apply a OneConnect profile - this is generally intended to aggregate multiple requests into a single TCP connection, but has the added benefit of protecting against TCP-based persistence.

    3. Issue an LB::detach command on each request

    The easiest option is usually to simply enable a OneConnect profile, but if you wanted to use the first option and still use the default VIP-configured pool assignment, your iRule might look like this:

    when CLIENT_ACCEPTED {
        set default_pool [LB::server pool]
    }    
    when HTTP_REQUEST {                    
        switch -glob [string tolower [HTTP::uri]] {        
            "/images*" {                                     
                pool pool_images
            }
            default {
                pool $default_pool
            }
        }
    }