Forum Discussion

Rajendra_129865's avatar
Rajendra_129865
Icon for Nimbostratus rankNimbostratus
May 26, 2014

Idle session causing LB session to move on another server in the LB pool

Hi,

We have an application accessed through LB VIP. VIP has two pool members, both are active. We are using an iRule to do session persistence on ASP.net_sessionID. Details of the VIP are listed below. We have observed that if session is idle for more than 3 minutes, it gets disconnected /transferred to another server in the pool. Kindly suggest me if the ASP.net_sessionID persistence iRule causing any error or needs correction in the iRule.

virtual VS.LBVIP { snat automap pool Application_https destination :https ip protocol tcp rules { switch_connection ASP.NET_Sessionid } persist cookie_20Min profiles { httpRewrite {} SSL-Certificate { clientside } serverssl { serverside } tcp {} } }

pool Application_https { lb method member least conn monitor all https members { 1.1.1.1:https {} 1.1.1.2:https {} } }

pool Application_http lb method member least conn monitor all http members { 1.1.1.1:http {} 1.1.1.2:http{} } }

rule ASP.NET_Sessionid { when HTTP_REQUEST { if { [HTTP::cookie exists "ASP.NET_SessionId"] } { LB::detach } set SessionId [HTTP::cookie ASP.NET_SessionId] if { $SessionId ne "" } { persist uie $SessionId } }

when HTTP_RESPONSE {

log local0. "Response SessionId is: $SessionId from Set-Cookies: [HTTP::header values Set-Cookie]"
  if {[HTTP::header exists "Set-Cookie"]} {
  foreach cookievalue [HTTP::header values "Set-Cookie"] {
            if { $cookievalue contains "ASP.NET_SessionId" } {
            set SessionId [findstr $cookievalue "ASP.NET_SessionId" 18 ";"]
            if { $SessionId ne "" } { persist add uie $SessionId }
            log local0. "Persist record [persist lookup uie $SessionId]"
       }
       }
  }

} }

rule switch_connection { when HTTP_REQUEST { switch -glob [HTTP::uri] { "/AAA" { SSL::disable serverside pool Application_http } "/BBB" { pool Application_https }

    }

} }

profile persist cookie_20Min { defaults from cookie mode cookie cookie mode insert cookie expiration 0:20:00 }

Thanks, Rajendra

6 Replies

  • We have observed that if session is idle for more than 3 minutes, it gets disconnected /transferred to another server in the pool.

    universal persistence timeout is 180 seconds by default.

    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm persistence universal
    ltm persistence universal universal {
        app-service none
        mirror disabled
        rule none
        timeout 180
    }
    
    • Rajendra_129865's avatar
      Rajendra_129865
      Icon for Nimbostratus rankNimbostratus
      Thank You nitass for your quick suggestion. We will try to create a customized persistence profile (which calls ASP.NET_Sessionid iRule) with increased timeout and assign it to the VIP and give a try to check the session. Thanks, Rajendra
  • We have observed that if session is idle for more than 3 minutes, it gets disconnected /transferred to another server in the pool.

    universal persistence timeout is 180 seconds by default.

    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm persistence universal
    ltm persistence universal universal {
        app-service none
        mirror disabled
        rule none
        timeout 180
    }
    
    • Rajendra_129865's avatar
      Rajendra_129865
      Icon for Nimbostratus rankNimbostratus
      Thank You nitass for your quick suggestion. We will try to create a customized persistence profile (which calls ASP.NET_Sessionid iRule) with increased timeout and assign it to the VIP and give a try to check the session. Thanks, Rajendra