Forum Discussion

sheida_84143's avatar
sheida_84143
Icon for Nimbostratus rankNimbostratus
Nov 06, 2008

beginner question: Routing to the same server

Hi there,

 

 

I am new here. I have a simple question. I have multiple servers load balanced by BigIP. I want all the requests from the same client go to the same server for a period of n minutes (as long as there is an active session). Is there a simple tutorial or write up about this?

 

 

Thanks.Sheida.

6 Replies

  • Hi Sheida,

     

     

    Try searching on AskF5.com for "persistence". It will allow you to ensure requests from the same client are persisted to the same pool member over a series of requests. For HTTP, the most common method is cookie insert persistence. If you have any questions, you can reply here or in the Advanced Config section.

     

     

    Aaron
  • Thank you Aaron, I did look the askF5 and there are different types of persistence, but the one I am looking for I couldn't find.

     

     

    In my case, the http request is coming from a mobile device, in the http header there is a unique device id. So here is what I want to happen:

     

     

    The first request from the device can go to any of the pool member because there is nothing persisted on that device id. The subsequent requests should go to the same pool member as the first request because the first one has some cahced information that the second request needs.

     

     

    I also want to control how many minutes the "persistent session" is active, and after how many minutes it will expire.

     

     

    Thanks.Sheida.
  • something like this shoudl work:

     

     

    when HTTP_REQUEST {

     

    if { [HTTP::header exists "phoneid"] } {

     

    set phoneid_resp1 [findstr [HTTP::header "phoneid"] "!" 1 "!" ]

     

    if { $phoneid_resp1 != "" } {

     

    persist uie $phoneid_resp1

     

    }

     

    }

     

    }

     

    when HTTP_RESPONSE {

     

    if { [HTTP::header exists "phoneid"] } {

     

    set phone_resp2 [findstr [HTTP::header "phoneid"] "!" 1 "!" ]

     

    if { $phone_resp2 != "" } {

     

    persist add uie $phone_resp2

     

    }

     

    }

     

    }
  • Thank you so much Radyen and Aaron I have two small questions. 1) What is the purpose of the persistence at the HTTP_RESPONSE. 2) Also I assume if I wanted to have the persistence be on both the phone number and the phone id (they are both present on the header), I could concatenate, right?
  • 1. it establishes a persistence table entry with the first reply then is follows for subsequent requests.

     

     

    2. You could but it would be less efficient, one or the other would establish the same result of persistence to a server and the other header then end hot have logic applied to it.