Forum Discussion

yashukawa_30473's avatar
yashukawa_30473
Icon for Nimbostratus rankNimbostratus
Feb 14, 2017

Load Balancing with limited Source IP

Hello all,

I'm having some trouble with balancing the load evenly to my web servers. In my configuration, there is a CDN infront of F5 and the CDN only has 2 IPs. Behind F5, I have 10 web servers in the same pool. Lb algorithm is Round Robin, with OneConnect and HTTP profiles attached to the VS. Persistence method is Cookie insert. With this configuration and under load, only 2 web servers process requests as there is only 2 source IPs. The cookie insert method depend on the source IPs so F5 keeps assigning them to only 2 servers.

In order to get rid of this problem, I'm trying to implement a Universal persistence profile but I'm having some problems.

I have a cookie set by the web server and I'm trying to persist using this unique cookie id. As long as the source IP remains the same, persistence works great and all requests hit the same node. However if the CDN node IP changes and the user keeps browsing the site, they are assigned to a different node, even though the cookie id remains the same. I believe F5 is creating a new persistence record for every IP that uses the same cookie id. Is there a way to force the client to use the same node no matter what, as long as his/her cookie id remains the same? I really don't wanna create duplicate persistence entries as it is a big problem.

OneConnect and HTTP profiles are assigned to the VS. My simple iRule is as follows;

when HTTP_RESPONSE {
  if { [HTTP::cookie exists "MySessionID"] } {
    persist add uie [HTTP::cookie "MySessionID"]
  }
}
when HTTP_REQUEST {
  if { [HTTP::cookie exists "MySessionID"] } {
    persist uie [HTTP::cookie "MySessionID"]
  }
}

I'm kind of new to F5, so any help would be greatly appreciated! What is an ideally load balanced persistence scenario with limited source IPs?

Version: BIG-IP 11.6.0 Build 5.0.429 Hotfix HF5

Kind regards, Christophe

2 Replies

  • I am assuming you are not using source IP based persistence as the default or fallback persistence profile.

     

    For persistence cookie insert, F5 inserts the cookie that provides information on the pool and member. Just the cookie insert persistence profile along with oneconnect persistence profile will provide the required persistence for CDN environment. I would recommend trying this out again as this is the simplest implementation that you would need. Flush any cache on the CDN side and then re-try this implementation.

     

    If you are concerned about uneven load balancing, you can try to utilize /32 netmask in the oneconnect profile. There will be some uneven load balancing with oneconnect as described in K10430.

     

  • Snl's avatar
    Snl
    Icon for Cirrostratus rankCirrostratus

    I am having the same issue , and about to try below options

     

    1) x forward client ip based load balancing using irule

     

    2) use cookie persistence

     

    Cheers snl