Forum Discussion

TWSS_18275's avatar
TWSS_18275
Icon for Nimbostratus rankNimbostratus
Jun 04, 2008

Problem with Switch

We are attempting to setup an iRule that will use a different pool based on the uri string. The problem we are having seems to be "sticky" pools. Here's the iRule:

  
  when HTTP_REQUEST {  
    switch -glob [string tolower [HTTP::uri]] {   
      "/path/*" {  
        persist none    
        log local0. "PWR -- old pool: '[LB::server pool]'"  
        pool pool_imagesrv  
        log local0. "PWR -- new pool: '[LB::server pool]'"  
      }  
      default {  
        persist none   
        log local0. "DEFAULT -- old pool: '[LB::server pool]'"  
        pool pool_test  
        log local0. "DEFAULT -- new pool: '[LB::server pool]'"  
      }   
    }  
  }  
  

and here's a snapshot of the logfile:

  
    
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- old pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- new pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- old pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- new pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : PWR -- old pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : PWR -- new pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- old pool: 'pool_imagesrv'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- new pool: 'pool_imagesrv'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- old pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- new pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- old pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- new pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- old pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- new pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- old pool: 'pool_test'  
  Jun  4 08:31:47 tmm tmm[1153]: Rule test_irule : DEFAULT -- new pool: 'pool_test'  
  Jun  4 08:31:48 tmm tmm[1153]: Rule test_irule : PWR -- old pool: 'pool_test'  
  Jun  4 08:31:48 tmm tmm[1153]: Rule test_irule : PWR -- new pool: 'pool_test'  
  Jun  4 08:31:48 tmm tmm[1153]: Rule test_irule : PWR -- old pool: 'pool_imagesrv'  
  Jun  4 08:31:48 tmm tmm[1153]: Rule test_irule : PWR -- new pool: 'pool_imagesrv'  
  Jun  4 08:31:48 tmm tmm[1153]: Rule test_irule : DEFAULT -- old pool: 'pool_imagesrv'  
  Jun  4 08:31:48 tmm tmm[1153]: Rule test_irule : DEFAULT -- new pool: 'pool_imagesrv'  
  Jun  4 08:31:48 tmm tmm[1153]: Rule test_irule : DEFAULT -- old pool: 'pool_test'  
  Jun  4 08:31:48 tmm tmm[1153]: Rule test_irule : DEFAULT -- new pool: 'pool_test'  
  

If you look, it appears that a request has to happens twice for a uri string before the pool gets change. Not sure what the cause is, any ideas?

2 Replies

  • Deb added a helpful post on OneConnect which explains the issue you're seeing:

     

     

    OneConnect? For my iRule?

     

    http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=114

     

     

    As an aside, if you add the TCP::client_port in each log statement, I think you''ll see an interesting pattern.

     

     

    Aaron