0

I'm working on a web-application which stores some info on the session, this has to stay active for at least 2 hours. ( a bit like a shopping-cart).

I'm working with Apache in front of multiple weblogic instances. The Apache is for caching + just some RR-balancing.

In my web.xml I have configured a session-time out of 120 minutes.

But now I'm wondering about all these Apache settings like the general "Timeout,KeepAlive,KeepAliveTimeout"

and also those that I can specify within the "balance-config", which currently is

SetHandler weblogic-handler

WebLogicCluster serv1:port1,ser2:port2

ConnectTimeoutSecs 10

ConnectRetrySecs 2

KeepAliveEnabled ON

KeepAliveSecs 15

WLCookieName WLBALANCECOOKIENAME

so here I can specify another KeepAliveEnabled / KeepAliveSecs

Do I have to put everything on keepalive=YES and the seconds to 7200+? This make sure my 2 hour session-timeout of web.xml will be respected?

the general "timeout" I can probably put lower because from what I understand this is for long-requests/responds.

gotjee
  • 43
  • 2
  • 9

1 Answers1

2

KeepAlive is not linked to session timeouts on weblogic.

The KeepAlive in the apache server is for improved performance by using a reusable pool of connections from the Apache plug-in to the WebLogic Server. If the connection is inactive for more than 30 seconds, (or a user-defined amount of time) the connection is closed and returned to the pool.

Still it is recommended to set KeepAlive ON and set the KeepAliveSecs 15 as default.

Now on to your main problem of enabling a 2 hour session timeout. Note: 2 hours is a high amount (the default is only 30 mins) and your Weblogic servers will be using up more memory keeping the session details alive.

I assume you are relying on Apache to direct to the correct Weblogic server based on the user's JSESSIONID. In that case - Apache will send the request to the correct Weblogic server in your cluster - and the user's session will stay alive on that server. Unless you switch on session replication which is another memory hogger.

But to answer your question, your 120 minutes should be respected based on the <session-timeout> setting in web.xml It is also possible to set this in weblogic.xml, but the overriding one is web.xml

JoseK
  • 31,141
  • 14
  • 104
  • 131
  • Thanks for your reply, so the apache timeout and keepalive settings don't have anything to do with my weblogic session I understand from your explenation. But what I have been wondering is the following, I loadbalance with the SessionID like you say. But apache then remembers too which sever it send a previous request with that sessionId and will sent it too the same one again, but.. how long does apache remember this? which apache-setting configures this? because this setting has to be over 2 hours too make sure all my request keep going too the same server even after 1h50m of inactivity etc. – gotjee May 24 '12 at 07:38
  • nope, apache is blind to this. the proxy plugin within apache checks the request for the JsessionId and extracts the serverid from it. it does a pure pass-through and does not remember or map the incoming client request to the outbound weblogic instance. see an example on another answer http://serverfault.com/a/364812/37747 – JoseK May 25 '12 at 05:48