Forum Discussion

zafer's avatar
zafer
Icon for Nimbostratus rankNimbostratus
Oct 22, 2008

.net persistence issue

Hello

 

 

here is my traffic flow

 

 

client --> ssl vpn-> Bigip vip-> webserver

 

 

the customer use .net application and i try to get aspsessionid and persist it with this code (cookie based)

 

 

http://devcentral.f5.com/wiki/default.aspx/iRules/ASP_SessionID_Persistence.html

 

 

i can see f5 get sessionid's and add age correctly but LB not working properly, some times i can see f5 load balance connection to each server but sometimes not!!

 

 

i cleared all persistence records (b persist all delete) and connections (b conn all delete)

 

 

then i tested 5 new client machine each clients load balanced to same server

 

 

What can be problem , why this irule interest client ip and port ?

 

 

i didnt understand two lines in this code it start "debug"

 

 

when HTTP_REQUEST {

 

set cli [IP::remote_addr]:[TCP::remote_port]

 

set SessionId [HTTP::cookie ASP.NET_SessionId]

 

if {$::debug}{log local0. "Client: $cli Request SessionId: >$SessionId<"}

 

 

if { $SessionId != "" } { persist uie $SessionId 1800 }

 

}

 

when LB_SELECTED {

 

 

if {$::debug}{log local0. "Client: $cli LB to: [LB::server addr]"}

 

 

}

 

 

regards

 

 

zafer

 

 

 

4 Replies

  • Hi Zafer,

    In addition to Stefans helpful comments, it looks like you're missing the section of the iRule where the response cookies are parsed for the ASP session ID. Without that, the second request would not be persisted to the same pool member as the first:

    http://devcentral.f5.com/wiki/default.aspx/iRules/ASP_SessionID_Persistence.html

     
     when RULE_INIT { 
       set ::debug 0 
     } 
     when HTTP_REQUEST { 
       set cli [IP::remote_addr]:[TCP::remote_port] 
       set SessionId [HTTP::cookie ASP.NET_SessionId] 
       if {$::debug}{log local0. "Client: $cli  Request SessionId: >$SessionId<"} 
       if { $SessionId != "" } { persist uie $SessionId 1800 } 
     } 
     when LB_SELECTED { 
       if {$::debug}{log local0. "Client: $cli  LB to:  [LB::server addr]"} 
     } 
     when HTTP_RESPONSE { 
       set SessionId [HTTP::cookie ASP.NET_SessionId] 
       if {$::debug}{log local0. "Client: $cli  Response SessionId: >$SessionId<"} 
       if { $SessionId != "" }{ persist add uie $SessionId 1800 } 
     } 
     

    Aaron
  • zafer's avatar
    zafer
    Icon for Nimbostratus rankNimbostratus
    Hi,

     

     

    i got application error when i use two server in pool

     

     

    i found same issue from google but i dont know how can i fix it

     

     

     

    http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.aspnet/2006-07/msg01538.html

     

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1090433&SiteID=1

     

    http://www.element-it.com/System.Web.HttpException-Request-timed-out.aspx

     

     

     

    regards

     

     

    zafer

     

  • Hi Zafer,

     

     

    It looks like the three articles you linked to refer to a few different application errors. What is the actual error you see with two members in the pool? With the full codeshare example, do you see clients being correctly persisted? If you're seeing persistence failures, can you change to source address persistence and see if the application errors are fixed? If so, it would seem the errors are related to persistence.

     

     

    Aaron
  • zafer's avatar
    zafer
    Icon for Nimbostratus rankNimbostratus
    Hi Aaron,

     

     

    first of all i dont understand something this is strange.

     

    i put on production and it worked 20-30 minutes, after that we saw application error then i took tcpdump and removed second member from pool

     

    we checked dump and persistency records, it works correctly but we see still errors.

     

     

    we hava invaliv view state error

     

    http://support.microsoft.com/default.aspx?scid=kb;en-us;555353&sd=rss&spid=6351

     

     

    i can not use source address persistency because clients comes with natted ip address.

     

     

    regards

     

     

    zafer