Forum Discussion

Riaz_125436's avatar
Riaz_125436
Icon for Nimbostratus rankNimbostratus
Oct 22, 2014

Understanding this iRule - to resolve upto 15 seconds lag while playing videos

Hi,

I need help in understanding the iRule below. I am also mentioning the VS setting for clarity.

    virtual vs_cdms_http {
    snat automap
    pool pool_cdms_http
    destination 10.0.2.10:http
    ip protocol tcp
    rules ir_cdms_http
    persist pr_dms_source_addr
    profiles {
    http {}
    tcp {}
    }
}

rule ir_cdms_http {
   when HTTP_REQUEST {
     SET DEBUG TO 1 TO TURN ON AND 0 TO TURN OFF
    set DEBUG 0
    set defaultURI "/windows/test.txt"

    if { $DEBUG } {  log local0. "DMS URI: [HTTP::uri]" }
    switch -glob [HTTP::uri] {
      "/" { set uri $defaultURI }
      default { set uri [string tolower [HTTP::uri] ] }
    } 
    }

   when HTTP_RESPONSE {
    set pserver [persist lookup source_addr [IP::client_addr] node] 

  if { $DEBUG } {  log local0. "DEBUG LINE TURN OFF IN PROD URI $uri PServer $pserver:Client Ip [IP::client_addr]:Active Members [active_members [LB::server pool]]" }
  switch -glob $pserver {
   10.0.0.1 { HTTP::redirect "http://abc001$uri"}  
   10.0.0.2 { HTTP::redirect "http://abc002$uri"}
   default {  HTTP::redirect "http://$pserver$uri" } 
  }
}
}

May I know, how this iRule will be effecting/processing the traffic?

Your help will be kindly appreciated.

  • I need help in understanding the iRule below.

     

    pserver is load balanced server (i.e. pool member which request was sent to).

     

    in short, the irule does http redirection based on load balanced server (i.e. switch statement in HTTP_RESPONSE event).

     

    to resolve upto 15 seconds lag while playing videos

     

    i think packet capture may be more helpful.

     

  • Thanks Nitass. I will do a capture and further update. So, what i understand is, by this config and iRule, all request towards VIP will load balanced to any of the servers. This iRule will process every new packet, and subsequent communication. Is this correct?