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