I have a web app running on Tomcat (Spring WebFlow, Hibernate are used). On of the app's features is misc. reports generating based on stored data (quite heavy task). We're experiencing perfomance problems with other functionality while performing this task (note, only for some of our customers).
So we've tried to create a cluster of two Tomcats ant put Apache HTTP with mod_jk in front of them. We've set masks in httpd.conf:
JkMount /appname alpha
JkMount /appname/* alpha
#reports
JkMount /appname/report beta
JkMount /appname/report/* beta
where alpha is primary tomcat and beta is a Tomcat implied to perform reports generating. So everything but report URLs is redirected to alpha and reports - to beta. Everything seemed to work properly, reports are really processed by the beta Tomcat, but the problem arose: we have quite large sessions size and session syncing between tomcats makes them dead in a while.
Is there a possibility to sync not the whole session, but only its part (When user submits /report/* URL, app on beta tomcat has to be aware that this is the same session as in the alpha. And, possibly, some app objects are needed too.)?
Note, that we don't want to make another application for reports functionality as for some customers with certain amount of data everything works fine on one tomcat, so we want to have only one build for all.