Session timeout with apache web server and weblogic cluster. JSESSIONID in response is not the same as the one in request

StackOverflow https://stackoverflow.com/questions/22098492

Question

We have an apache web server (version httpd-2.2.22-win32-x86-openssl-0.9.8t) with weblogic (version 10.3.2) cluster having 3 nodes. In our load testing, we get session timeout errors in some cases (less than 1%). This was happening, even if we have -1 for session timeout in the web.xmls of weblogic nodes. After days of debugging, we realized that in some cases, the JSESSIOID sent by request is not honored by the response. Fiddler traces show that the RESPONSE has a header named Set-Cookie:JSESSIONID and the value for this is different from the JSESSIONID sent in the request. We get the session expiry page immediately. As already mentioned, this happens only in some rare cases.

Was it helpful?

Solution

When using WeblogicCluster, the requests have session affinity. Thus the requests go to the same node where the initial contact was made. But the issue turned out to be that at high loads, the nodes were not responding. Thus the requests go to the other nodes. This is the default behavior with WeblogicCluster. Since we do not have session replication and failover enabled, any request that goes to the secondary nodes would give us session timeout error. One solution to this was to start supporting session replication and failover in weblogic. But we did not want that as the impact was high.

These were the configuration changes that fixed this issue

In httpd.conf

    ConnectTimeoutSecs 50 (default is 10)
    ConnectRetrySecs 5 (default is 2)
    WLSocketTimeoutSecs 10 (default is 2)
    WLIOTimeoutSecs 18000 (default is 300)
    Idempotent OFF (default is ON)

The first 2 changes in ConnectTimeoutSecs and ConnectRetrySecs means that retry would 10 times (50/5) instead of the default 5 (10/2)

In weblogic nodes

domain --> environment --> servers --> click on the required server -->
    tuning--> Accept Backlog:
    --> default value is 300. Made it 375.
   restart the weblogic nodes and apache

For more details refer http://docs.oracle.com/cd/E13222_01/wls/docs81/plugins/plugin_params.html http://docs.oracle.com/cd/E13222_01/wls/docs81/plugins/apache.html . Refer the diagram here for the

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top