Forums Register Login

EJB Clustering: Initial design

+Pie Number of slices to send: Send
Hello,
I am looking at a Weblogic CLustering setup.
Have a basic question.

When a user has a Active HttpSession(in one instance), we keep a handle to the StatefulSession EJB in the Http Session. Further the HttpSession Keeps many domain objects.

With Clustering, will Weblogic ensure that the complete HttpSession Data is replicated on both Weblogic Clusters? This can be expensive, with double memory and processing?

Additionally, when a user makes multiple requests, can they switch between the cluster servers, or will does WL provide Session Affinity, and switchover only during a failure?

Please share your ideas,
- Avi
+Pie Number of slices to send: Send
Hi Avi,


With Clustering, will Weblogic ensure that the complete HttpSession Data is replicated on both Weblogic Clusters?


Weblogic uses several forms of session persistence and the two most commonly used are in-memory replication (used by SFSBs as well) and JDBC persistence. Hence the session information can persist to server failures. The way it works might be pretty intuitive for JDBC persistence but is not so obvious for in-memory replication (which is probably the most common choice). In a nutshell after creating the HttpSession object on the primary server, Weblogic will also pick another secondary instance and will copy the session data as well. Finally it will encode both addresses into the session ID cookie (or use the url-rewriting technique if cookies are disabled). Form now on Weblogic will always keep both primary and secondary servers in sync (using Ip-multicast protocol) and will make sure that all client requests with the same session Id will be redirected to the same primary. If primary goes down, Weblogic will promote the secondary to primary and will pick another secondary from the available instances in the cluster.


This can be expensive, with double memory and processing?


Yes it does. When using in-memory replication Weblogic will replicate the whole graph if an object is changed. Therefore is more efficient to bind into the session more fine grained objects, rather than few coarse grained objects. Is important to notice that changing an object bound into the session (using either setAttribute or removeAttribute), will result in replicating only that object and not the entire HttpSession data. In contrast, changing any value in a SFSB will result in replicating the whole stateful session data.


Additionally, when a user makes multiple requests, can they switch between the cluster servers, or will does WL provide Session Affinity, and switchover only during a failure?


Weblogic uses two techniques for routing http requests: either a special Web server plug-in, or a hardware load balancer. The former will always check if the current http request has a session id and will redirect it to the appropriate primary instance. Otherwise it will use a specific load balance algorithm (default is round-robin). The second approach is little bit more complex, but it could become pretty efficient if the hardware load balancer uses a sticky load balancing algorithm (all client requests goes to the same instance).
Regards.
+Pie Number of slices to send: Send
Very Very helpful. Thanks much.

Owe you one.
+Pie Number of slices to send: Send
You're very welcome Avianu. I'm glad I could help
Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 673 times.
Similar Threads
problem encountered with clustering
Session
Shopping cart strategy for part 2. JSF with session scope or Stateful Session Beans?
EJB method is executed twice.
Who Creates the HttpSession , User or Weblogic
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 05:57:03.