I have two servers with 6 instances of Webshpere application server on each i.e., 2 Severs and 12 instances in total and using F5 load balancer to route the traffic using Round Robin load balancing method.
Now, we have soap api calls from the client which sends some request to the load balancer and then the LB routes it the any instance as per availability.
But, sometimes the session which is started on one instance, if any other call happens for the same session and it routes to different instance, the calls gets error out stating Invalid SessionID.
for this we need to maintain some form of stickyness at the Load Balancer. Request any help in form of configurations/screenshots as to how to implement stickyness at LB to maintain persistence for the session which has been started at one instance, later any request for the same session goes to that particular instance only.
One thing to add. The application on which the LB is routing the request generates a sessionID for each startSession call and the client using soap api is using this sessionID to make subsequent calls.
You have many persistence profiles on the F5 if you have the LTM license.
If your clients supports cookie (example browsers) you can use "cookie" persistence profile for the "Default Persistence Profile" and then choose the "source_addr" persistence
for the "Fallback Persistence Profile".
Indeed, if client does not support "cookie" (example fatclient) it will use the fallback method.
In this manner you will ensure that all client traffic goes to the same node for a same session.
To configure this go to "Local Traffic ›› Virtual Servers : Virtual Server List ›› vs-name" choose the second tab "Resources" and choose "cookie" and "source_addr" for persistence profiles.
Hope it helps
Please give me a feedback
Thank you for the response. I will try to check as per your suggestion. However, I wanted to elaborate on my question:
A StartSession Call is initiated by the API Service to the destination application system.
The application starts a session and responds with a SessionID.
(This happens lets say on Server 1 Instance 1)
With the SessionID generated, the API Service uses the sessionID generated by the application and
calls a GetOffer request. This has to go to the same instance as it has the sessionID.
With the SessionID, the API service calls another method to postEvent.
These request after StartSession call if going to any instance other than where it started are Invalid.
We have a parameter "SessionID" which is generated by the application itself and sent to the API service client and they use it for their subsequent calls for the same session.
Is there any way, we can use this parameter to implement stickyness at Load Balancer or the cookie based will work with this.
Thanks & Regards.
First try using the cookie with source_addr as fallback profile.
Let me just explain how it works :
1) When a client make a request for the first time to the VS, the BIG IP system check if it is a valid request. After that it will transmit the request to the pool member (the backend server). If a persistence is configured then it will:
option 1 (using source_addr, hash, universal,... or other persistence profile) : it will add an entry in its persistence table. This entry will say if "source_IP_X then go to node_1" if "source_IP_Y then go to node_2" and so on...
option 2 (using cookie): it will wait for the response of the server (that will respond with the Session ID attributed to the client) and insert a cookie. This cookie informs the BIG IP to which node it should pass traffic for next request. Example: when the client request a second time, it will play the cookie, the F5 will read this cookie and send it to the correct/same backend server.
To make it easy if cookie = 1 go to node_1 if cookie = 2 go to node_2.
2) In your case if you need to send always a client with a specific SESSIONID to the same instance for all the SESSIONID life, you can use existing default persistence profile as suggested in my first answer.
3) If it doesn't work like that we can build an irule with universal or hash persistence profile that will generate entries in the table based on the SessionID.
Most web applications works very well with cookie and source_addr.
Let me know
Thank you JTI for your response and detailed explanation.
One more thing I needed to confirm on this, does the API or client need to store this cookie so that next request when they send for same sessionID, the LB reads that or is it not required and it will be taken care at LB end.
If you use cookie persistence, then the client must store and provide the persistence cookie with every request.
With source_addr persistence, the LTM maintains a persistence table and will maintain the connection correctly.
You can also use Universal Persistence with the sessionID
K7392: Overview of universal persistence
This links to a specific example
Weblogic JSessionID Persistence
It depends, if your client supports cookie or not, browsers support cookie so they will automatically read the cookie set with the header "set-cookie" sent by the server or inserted by the big ip.
If other client is used you need to validate if it supports cookie ir not if not you can not modify this it is not a big problem since you configured a fallback persistence profile
Thank you Blakely and JTI. I will work on this and let you know.
It would require you to create an irule to route the traffic depending upon the value of the session ID you are mentioning.
Thank you for the response.
Is there any way to capture this SessionID which the application is sending to the client at the Load Balancer F5 BigIPServer.
Can you suggest how to capture this value and write an iRule to implement stickyness.
Thanks & Regards
You would require to capture the traffic using wireshark or any other sniffer to get the session ID details. You can use the following commands on F5 to get the packet captured and analyse it using wireshark:-
tcpdump -s0 -ni 0.0:nnnp -w /var/tmp/test_app.pcap
(test_app - is the filename which you can change depending upon your testing). You can then copy this file from your host F5 to your computer using SCP and then analyse it.
I would suggest, first to enable cookie persistence and then check the load balancing, whether it meets your requirement or not.There are chances that it can be supported.
The persistence irule will depend upon the kind of session ID that gets generated.
Let me know the format and I shall try to create one for you.
Thank you Amy. Will get back to you in case of any help.
Hi Sudhashu did this problem resolve, i am facing a similar issue using cookie persistence