You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Gudla, Natraj (GE Money, consultant)" <na...@ge.com> on 2008/10/08 16:11:45 UTC

Problems with Axis Http Connection Manager not closing connections

Hi All, 
 
We are using Axis2 1.3 version and seems to be facing problems with the
management of the http connectins via the Http connection manager.
Within our application we have a stub call which ends up calling a
webservice deployed as part of the same application. Basically it is a
localhost webservice call, which is routed back into the server. We are
running our production kit on Red Hat Linux 64 bit and on Sun App Server
9.1 
 
While performing load tests which involve a webservice call for every
virtual user(repeatedley with a think time of one minute), the server
seems to be struggling with open connections having an impact on any new
connections being acquired by the code. We can see atleast 150+
CLOSE_WAIT state connections on the server after the tests are stopped
which suggests the program is unable to close them gracefully while the
OS is waiting for them to be closed. 
 
We are using the following settings, Please advice if any suggestions
you may have to improve this situation. 
 
Following code is set-up only once on the first call :
HttpConnectionManagerParams connectionManagerParams = new
HttpConnectionManagerParams();

connectionManagerParams.setTcpNoDelay(true);

connectionManagerParams.setStaleCheckingEnabled(true);

connectionManagerParams.setDefaultMaxConnectionsPerHost(numOfConnections
);

connectionManagerParams.setSoTimeout(60000);

connectionManagerParams.setConnectionTimeout(60000);

conmgr = new MultiThreadedHttpConnectionManager();

conmgr.setParams(connectionManagerParams);

client = new HttpClient(conmgr);

 

For every user call for a webservice, following stub code is used :
Following code uses the client which was instantiated above. 

stub=new ApplicationStub(SystemParameters.configurationContext,url);

stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(timeout);

//Set HTTP Protocol Version

stub._getServiceClient().getOptions().setProperty(org.apache.axis2.trans
port.http.HTTPConstants.HTTP_PROTOCOL_VERSION,org.apache.axis2.transport
.http.HTTPConstants.HEADER_PROTOCOL_11);

stub._getServiceClient().getOptions().setProperty(HTTPConstants.REUSE_HT
TP_CLIENT, Boolean.TRUE);

stub._getServiceClient().getOptions().setProperty(HTTPConstants.CACHED_H
TTP_CLIENT, SystemParameters.client);

ConfigurationContext configContext = new
ConfigurationContext(stub._getServiceClient().getAxisConfiguration());

configContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
SystemParameters.client);

Thanks
Natraj.