• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

load balance with session info

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 493
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Denis Wang
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 493
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot. very interesting.
Best,
Denis
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic