views:

1414

answers:

3

If two webserver are configured in between a load balancer and weblogic cluster, will the two Apache server maintain session stickiness.?? Say for e.g. the load balancer forwards the first request to the 1st apache and inturn 1st apache forwards to 1st WL managed instance.Even if the second req from the same user is forwarded by the load balancer to the second apache, will the sec apache be able to forward it to the 1st WLManaged instance which served the first request rather than the sec WLManaged instance which is not aware of the session information at all.What should ideally be the behaviour of weblogic apache plugin??.Catch is i dont want ot enable the session replication @ the wl server cluster..Pls help.

+1  A: 

According to the section "Failover, Cookies, and HTTP Sessions" of the Apache HTTP Server Plug-In:

When a request contains session information stored in a cookie or in the POST data, or encoded in a URL, the session ID contains a reference to the specific server instance in which the session was originally established (called the primary server) and a reference to an additional server where the original session is replicated (called the secondary server). A request containing a cookie attempts to connect to the primary server. If that attempt fails, the request is routed to the secondary server. If both the primary and secondary servers fail, the session is lost and the plug-in attempts to make a fresh connection to another server in the dynamic cluster list. See Figure 3-1 Connection Failover.

Note: If the POST data is larger than 64K, the plug-in will not parse the POST data to obtain the session ID. Therefore, if you store the session ID in the POST data, the plug-in cannot route the request to the correct primary or secondary server, resulting in possible loss of session data.

Figure 3-1 Connection Failover

alt text

In other words, yes, both Apache servers will be able to forward an incoming request to the "right" WebLogic instance as the session ID contains all the required information for that. Note that there is no real need to confirm this with testing but it would very easy though.

UPDATE: Answering the following comment from the OP

I think this document stands good for only one apache server. In my case I have two and the load balancer forwards the requests to both the servers in a 50:50 manner. I did test this and the weblogic plugin is not maintaining the stickiness.

I understood you are using two apache fontend and I'm not sure this document applies to configuration with one apache server only. As explained, the session ID contains a reference of the primary server (and the secondary server as well) so both apache should be able to deal with it. At least, this is my understanding. Actually, I've worked with a similar configuration in the past but can't remember if things were working as I think they should or if the load balancer was configured to handle stickiness too (i.e. forward to a given Apache server). I have a little doubt now...

Could post your plugin configuration (of both apache server if they differ)? Could you also confirm that things are working as expected when only one apache server is up (and test this with both apache if their configuration differ, which shouldn't be the case though)?

Pascal Thivent
A: 

Hi pascal..Thanks for u r reply..I think this document stands good for only one apache server.In my case i have two and the load balancer forwards the requests to both the servers in a 50:50 manner. I did test this and the weblogic plugin is not maintaining the stickiness,.

h4tech
Please post this as a comment to my answer, not as a new answer (it is not an answer). Then we can go further discussing this.
Pascal Thivent
My intension was to add it as a comment, but site didnt give any option to do so. Even now iam not able to add comment to ur answer..Anways thanks for ur time..
h4tech
A: 

When you have 2 Apache instances with a TCP load balancer in front, the stateflow diagram is not applicable anymore, because the Apache instances do not share their states. I guess that the WebLogic plug-in maintains a state with a directional mapping [IPAddress+Port -> JVMID]. If it receives a cookie with a JVMID it does not know yet (for instance, it has never sent a request to this server yet), it has no way to know which IPAdress+Port it refers to, so it will not be able to reuse these JVMID and it will reassign new primary/secondary ones, which will be identical for 2 instances (maybe swapped), and which might be different if there are strictly more than 2 instances. I did not confirm it by running specific tests, but on paper it seems not to work in all cases.

metatech