Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

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

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

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.

0
Comments on this Answer
Comment made 15-Nov-2013 by abhijitz 2
1. No that is not the requirement. A JSESSIONID 'X' can land on application server 1. Request URL will get constructed & if that URL need to access certain REST APIs on the REST Server, it will utilize Node Server to make the call. In essence, "X" JSESSIONID do not need to be maintained down the chain. 2. This is failing on the REST VIP (configured on F5_2 pair). When REST VIP is hit with requests from the Node.JS servers, the requests are separating out (i.e. loadbalancing on the REST servers) for the same JSESSIONID. Example : What is happening :: User 1 --> 1234abcd=JSESSIONID --> 36 calls --> 19 goes to REST Server #1 , 18 goes to REST Server #2. [and subsequent Users ..... User<N> ] What we want :: User 1 --> 1234abcd=JSESSIONID --> 36 calls --> 36 calls goes to Rest Server #1, User 2 --> 5678efgh=JSESSIONID --> 30 calls --> 30 calls goes to Rest Server #2, and so on ... [Thus we are trying LB Method = RoundRobin & trying to find the right persistence] --> Double-up the Virtual Servers is not a possibllity. We can try Priority Group and put back the same iRULE as described in SOL11427 Thanks for your feedback!
0
Comment made 15-Nov-2013 by What Lies Beneath 6719
OK, and can I assume you're not running v11.0 - 11.2.1?
0
Comment made 15-Nov-2013 by abhijitz 2
Yep 11.2.1
0
Comment made 18-Nov-2013 by What Lies Beneath 6719
OK, could be a bug, see below.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Oneconnect, oneconnect, oneconnect

0
Comments on this Answer
Comment made 15-Nov-2013 by IheartF5 2377
Great concise problem description BTW.
0
Comment made 15-Nov-2013 by abhijitz 2
--> OneConnect has not been tested yet. I will check this today.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

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.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

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.

0
Comments on this Answer
Comment made 18-Nov-2013 by abhijitz 2
Ok - Good Idea. Will try it today.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Is Match Across Services configured? If so there's a bug you should be aware of with your version: http://support.f5.com/kb/en-us/solutions/public/14000/000/sol14061.html

0
Comments on this Answer
Comment made 18-Nov-2013 by abhijitz 2
I read about that bug, but then i already have the HotFix installed for 11.2.1
0
Comment made 18-Nov-2013 by What Lies Beneath 6719
OK, understood. What's your persistence timeout?
0
Comment made 22-Nov-2013 by abhijitz 2
900 seconds (my application persistence is 960 seconds). Objective is to persist the same JSESSIONID and all its subsequent calls to one server. Those 30+ calls for the same JSESSIONID can happen over a period of 15 minutes.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

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

0