Session replication across JVMs in WebSphere

元气小坏坏 提交于 2019-12-05 00:47:51

问题


We have an infrastructure set up where in the webservers are clustered and the application servers are not. The webservers route the request to the application servers based on round-robin policy.

In this scenario, the session data available in one application server is not available in the other application server. Is there anyway by which the session data from first application server can be made available in the second application ? The two application servers are physically separate boxes in different cells.

One approach could be to use the database - is there any other means of accomplishing this session replication ?


回答1:


In WebSphere there are essentially two ways to replicate session data:

  1. Persisting to a database
  2. Memory-To-Memory transfers

Which one is appropriate for your needs is highly dependent on your application scenario:

How important is the persistence of your session data, when all your application servers go down? How many session objects do you have at any one time simultaneously?

In a DB you can store many sessions without much problems, the other option is always a question of how much memory is available.

I would go with the database, if you already got one set up, which all application servers use anyway.

Here is the link to the WebSphere Information Center with the necessary details.




回答2:


One obvious solution is to enable clustering of your application servers. I assume from the way you worded your question you have rejected this option. Another option is to change the routing used by the web servers to use session affinity (requests for the same session go to the same app server).

Other that that, I'd second the answer by dertoni.




回答3:


maybe you can look at 'terracota'. its an caching framework, which can cache sessions and runs on a seperate server




回答4:


There are two options for clustering within WebSphere, session replication or database. If you have large session objects you are best off using database because it allows you to offload stale sessions to disk. If they are then represented then they can be extracted from the database, if you use session replication then those sessions need to stay in memory on not just your target server but also the other servers in the replication group. With large sessions this can lead to an out of memory condition.

With database session handling it is also very customisable and doesn't performance noticeably in the environments that I have used it.




回答5:


don't forget oracle coherence.



来源:https://stackoverflow.com/questions/939253/session-replication-across-jvms-in-websphere

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!