Forum Discussion

abhijitz_954's avatar
abhijitz_954
Icon for Nimbostratus rankNimbostratus
Nov 15, 2013

Issue with LoadBalancing while trying to maintain persistence with JSESSIONID

My setup is as follows: Users --> {F5_1 App VIP --> App Servers} --> Node.JS Servers (F5_1 Node VIP} --> F5_2 REST VIP --> App [REST] Servers.

 

This is a multi-tier application, wherein an enduser will connect to our application servers & from the user's browsers, connection will be initiated to the Node servers, which in turn will make a call to certain REST APIs. No issues with LoadBalancing on F5_1 pair.

 

The problem statement : Loadbalancing of REST servers on F5_2 pair when Node.JS servers make the call. We want the same user session to be persistent on 1 REST server and the other user session on 2nd REST serer which is not happening.

 

What was tried ? :

 

We picked up the JSESSIONID iRule available as a solution (SOL11427 ), created an Universal Persistence profile and attached this iRule to the VIP and kept LoadBalancing as Round Robin. No luck. Connections would persist to the 1st REST SERVER only [i.e. you can see unique JSESSIONIDs hitting the same server. 2nd server received no traffic]

 

We changed the persistence to cookie, and made it custom to pick up the cookie value as JSESSIONID. This worked and the REST servers were getting "even" traffic. However, the VIP exhibited a HUGE number of persistent connections (around 20,000 per server). Apparently, it counted 1 unique id for 1 call even for the same JSESSIONID. i.e. if an end user, with 1 JSESSIONID makes 36 requests/calls to our server, there were 36 unique connections to the VIP. So apparently our LR script which had 1800 users to login with eventually turned up with 40K+ connections. This is scary, because we think this will overtax the micro kernel when more VIPs are configured.

 

We then changed the persistence to in-built cookie, (which inserts an hash). Loadbalancing happened fine but the wierd thing it did was; it took 1 JSESSIONID, split the number of requests for that JSESSIONID and sent it to 2 servers. In a stateful user session, this will not work [LR script worked fine as it was stateless].

 

We use SNAT off a NAT pool. We have not enabled OneConnect yet.

 

How can i fix this problem ? Appreciate your help.

 

PS : SOL11427 iRule : https://devcentral.f5.com/wiki/irules.Weblogic_JSessionID_Persistence.ashx

 

9 Replies

  • Sorry, can you clarify two things please?

     

    1) Is your requirement to in the same way throughout the service chain, i.e if a user hits app server 1, app server 1 must hit node.js server 1, must hit REST server 1? If so, why?

     

    2) Where is exactly is this failing? You mention node.js to REST server but also 'user' in the same sentence which is somewhat confusing.

     

    My feeling here is that if you use Priority Group Activation and double-up on the Virtual Servers, you can make this work.

     

  • No luck with OneConnect enabled.

     

    Tried, in-built COOKIE persistence, custom-COOKIE persistence, and applying the JSESSIONID iRule as a Universal persistence Profile. I still see 20K connections per server. I need to parse the access logs though, if the same JSESSIONID is bouncing across the 2 REST Servers.

     

  • You've got oneconnect and http profile on ALL your VIPs? It's got to be easy to troubleshoot. Put a logging statement in your persistence iRule. Add an iRule to your VIP and log the JSESSIONID cookie value in HTTP_REQUEST. Log from LB_SELECTED to see the server selected. You should figure it out.

     

  • Was there any solution for this problem? I am also facing it.