dcsimg
?? Working with session data and multiple web servers
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Blake_Minghelli
Posted On:   Thursday, August 29, 2002 10:56 PM

I am working on my first servlet/jsp project. Each page the user navigates to is used to build a piece of a larger java object. The result object is very normalized so it takes several pages to build it. Storing the object in the session works great as long a you're only dealing with one web server. But, to promote load balancing, we have 2 physical servers, each one running 4 instances of iPlanet 4.1 Enterprise Web Server, for a total of 8 web servers handling the requests. iWS 4.1 does not provide session tracking support for "clustered" servers. The firewall sends the requests to the individual web servers in a sort of "round-robin" approach so it is highly likely that each request sent by one user will be handled by a different web server,    More>>

I am working on my first servlet/jsp project. Each page the user navigates to is used to build a piece of a larger java object. The result object is very normalized so it takes several pages to build it. Storing the object in the session works great as long a you're only dealing with one web server. But, to promote load balancing, we have 2 physical servers, each one running 4 instances of iPlanet 4.1 Enterprise Web Server, for a total of 8 web servers handling the requests. iWS 4.1 does not provide session tracking support for "clustered" servers. The firewall sends the requests to the individual web servers in a sort of "round-robin" approach so it is highly likely that each request sent by one user will be handled by a different web server, so building the object in the HttpSession is useless.

   <<Less

Re: ?? Working with session data and multiple web servers

Posted By:   d_d  
Posted On:   Friday, September 6, 2002 10:08 AM

I would suggest two approaches:


1. Buy an intelligent dispatcher and place it in front of those servers. Once a session was opened on a certain server the dispatcher will keep routing the subsequent requests (coming from the same user) to that server. Basically there are IP and respectively cookies based dispatchers. It would be ideal to have one based on cookies. Those based on IP adresses may be fooled by proxies or providers that dinamically change IP adresses (AOL is the best example). The only problem is that when you want to shut down one server you need to wait until all session started on that server will end.


2. Implement a session persistence mechanism. Design a table in a commonly accessible database, serialize and save the content of the session each time it's content has been changed. For each incoming request keep track of the timestamp of last database update and retrieve the session accordingly. Java serialization in conjuction with a BLOB declared field in database will work well.

Re: ?? Working with session data and multiple web servers

Posted By:   Rob_Misek  
Posted On:   Wednesday, September 4, 2002 12:21 PM

I would also suggest looking at the Tangosol Coherence product. It allows you to share data between JVMs in a clustered environment through the java.util.Map interface. It also has locking mechanisms and implements the JavaBean event model. This is a pure java solution and can run on any app server.

We have developed HTTP session replication modules built on top of coherence for Tomcat, WebSphere 4.0 and any Servlet 2.3 compliant application servers.

Check it out at http://www.tangosol.com/coherence.jsp

Regards,
Rob Misek

Re: ?? Working with session data and multiple web servers

Posted By:   Raj_Subramani  
Posted On:   Friday, August 30, 2002 06:56 AM


IMHO XMLize (store as a CLOB if need be).


Something like Castor might help.



Cheers

-raj

About | Sitemap | Contact