wood burning stoves 2.0*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes load balance with session info Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "load balance with session info" Watch "load balance with session info" New topic
Author

load balance with session info

Denis Wang
Ranch Hand

Joined: Jan 23, 2004
Posts: 81
Hello,
Suppose I have two web servers. Session info is maintained in web layer instead of EJB layer. How can I achieve load balance/sharing?
Thanks.
Best,
Denis
Bharat Ruparel
Ranch Hand

Joined: Jul 30, 2003
Posts: 493
Hello Dennis,
One, you have to make sure that the objects stored in the HttpSession object are serializable. This is to ensure proper session migration in the event of a server failure in the web/presentation tier.
Two, you use either a software or a hardware load balancer for load-balancing which can offer a set of schemes for load distribution, e.g., round-robin.
Hope this helps.
Bharat


SCJP,SCJD,SCWCD,SCBCD,SCDJWS,SCEA
Denis Wang
Ranch Hand

Joined: Jan 23, 2004
Posts: 81
I am wondering what are the architecture impacts of session replication in a clustering environment. Is there any severely performance penalty?
Basically my question is, which approach is better:
1) Don't support session failover. Considering the business nature of a ticketing system, failover and recovery may not be necessary. therefore no need to synchronize the session states among clusters.
2) Replicate session states in memory or in hardware.
Bharat Ruparel
Ranch Hand

Joined: Jul 30, 2003
Posts: 493
Hello Denis,
The session clustering does have an overhead, I have first hand experience in it. We had a production system where we were working with a three tier system with session state being maintained in HttpSession in the presentation tier as well as Stateful Session Beans in the Business tier. We found that it carried an overall overhead of about 25% when using a clustered environment in terms of speed of execution. The thoughput and capacilty increased though.
To answer your question: I am not sure if you want to show the details of the clustered environment in the component diagram, it will needlessly complicate it. However, in your design notes/assumptions document, you may want to briefly address the load-balancing and fail-over, i.e., clustering benifits. That is what I am leaning towards for my solution.
Hope this helps.
Regards.
Bharat
Denis Wang
Ranch Hand

Joined: Jan 23, 2004
Posts: 81
thanks a lot. very interesting.
Best,
Denis
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: load balance with session info