hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wittmann Armin" <awittm...@ethz.ch>
Subject after 60000 requests more than 700 sockets in CLOSE_WAIT
Date Tue, 04 Sep 2007 11:22:53 GMT

Hi httpclient-Team

over the last 4 days I made a long term test for
our new software release.

This software ist integrated into an Apache Tomcat 5.5
(as a servlet receiving requests, transform them and
sending out other GET-requests through http-client) and should
run very reliable and without any resource leaks.

After finishing this test cycle I noticed that there
remained over 700 sockets in CLOSE_WAIT state
 (Linux -> netstat -a -p). 
Due to the identified PID and the destination ip number it is
obvious that these sockets have been caused/used
by the program part using http-client-3.0.1.

I am not a real network crack so I don't know if I need
to bother about this. Since the software/tomcat is itended
to run months (7x24) without necessarily rebooting it
I am not shure if I will run out of network resources.

Can somebody help in this subject?

By the way: all 60000 http-GET-requests worked well and there
	were no other problems at all.

Regards

Armin

--------------------------------------------------------------------
My Code (simplified):
this code ist executed for every single request

HttpConnectionManager connectionManager = new
SimpleHttpConnectionManager();
HttpClient client = new HttpClient(clientParams, connectionManager);
client.setHostConfiguration(hostConfiguration);
HttpMethod method =  = new GetMethod();
method.setQueryString(pairs);
method.setPath(pUrl.getPath());
method.setParams(methodParams);
try {
	client.executeMethod(method);
} catch (Exception e) {
	failed = true;
	throw new Exception(...);
} finally {
	if (failed) method.abort();
	
	method.releaseConnection();
			
	client.setHttpConnectionManager(null);
	client = null;
}

try {
	responseString = method.getResponseBodyAsString();
} catch (Exception e) {
	throw new Exception(...);
} finally {
	method.releaseConnection();
	method = null;
}

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message