Forum Discussion

Donovan_Price_1's avatar
Donovan_Price_1
Icon for Nimbostratus rankNimbostratus
Mar 25, 2010

Irule for Universal Persistance Using a Header Value

Hi

 

 

I have created the Irule that reads the value of MySessionId from the header I have removed the logging entries from below to make it simpler what I see is the following: the MySessionID is read successfully and is visible in the Stats Persistence Universal. However the users are not being stuck. I have confirmed the Sticky configuration is configured correctly so I guess the issue must be in my irule below. Also what is the max length value that can be in "MySessionId" and can it be negative.

 

 

when HTTP_REQUEST {

 

set Sid [HTTP::header value "MySessionId"]

 

 

if { $Sid != "" }{

 

set value [persist lookup uie $Sid]

 

if { $value != ""}

 

{

 

persist uie $Sid

 

}

 

else

 

{

 

persist uie $Sid

 

}

 

 

}

 

 

}

 

 

Thanks.

5 Replies

  • Sorry should of attached the below.

     

     

    I have got the following layout.

     

     

    VIP (80) --> Universal Persistence --> Pool -->

     

     

    I have multiply source servers however I need to persist a user request to VIP to the same Pool member irrespective of the Source Server. So what the app does on the src server is it create a header value using some user details and sends that with every request. So on the VIP use universal persist to extract the header value and then send to the correct pool member.

     

     

    All SRC servers have different src IP's.

     

     

    I suspect the issue could be with the oneconnect profile. I had to use a oneconnect to get past the fact that the src servers only make one connection and then send info for multiple sessions down it. By enabling One Connect I am able to move the requests to the correct destination servers. The issue I see is possibly that the Mask on the oneconnect is 255.255.255.255.

     

     

  • That mask isn't really an issue here, and is probably what you'll need to meet your requirements. It basically means you'll do a little less multiplexing, but you'll get your persistence to work. It'll still help your connection management, but not as much as with the default mask of 0.0.0.0. Personally, I'd like to see it default to 255.255.255.255 anyhow, as this solves a bunch of common issues right away.

     

     

    -Matt
  • Thanks Matt

     

     

    Do you perhaps any other suggestions as to why the Irule I listed is not working correctly.

     

     

    - Don
  • Hi Don,

    Can you try adding some logging, reproduce the issue and post the anonymized log entries from /var/log/ltm?

     
     when HTTP_REQUEST { 
      
        set Sid [HTTP::header value "MySessionId"] 
        log local0. "[IP::client_addr]:[TCP::client_port]: \$Sid: $Sid" 
        if { $Sid != "" }{ 
           set value [persist lookup uie $Sid] 
           log local0. "[IP::client_addr]:[TCP::client_port]: \$value: $value" 
           if { $value != ""}{ 
              persist uie $Sid 
           } 
        } 
     } 
     when PERSIST_DOWN { 
      
        log local0. "[IP::client_addr]:[TCP::client_port]" 
     } 
     when SERVER_CONNECTED { 
      
        log local0. "[IP::client_addr]:[TCP::client_port]: [IP::server_addr]:[TCP::server_port]" 
     } 
     

    Also, when you say the app inserts a header in the requests, how does this happen? Is the client a standard browser? I didn't think a server could force a client to insert an arbitrary HTTP header in a request.

    Thanks,

    Aaron
  • Hi

     

     

    Thanks , Yes I will do as you mentioned. Unfortunately with all the holidays I will only be able to do it on the week of the 6th of April.

     

     

    I will let you know the results as soon as I have them.

     

     

     

    Thanks.