MultiThreadedHttpConnectionManager exceeds MaxTotalConnections
---------------------------------------------------------------
Key: HTTPCLIENT-623
URL: https://issues.apache.org/jira/browse/HTTPCLIENT-623
Project: HttpComponents HttpClient
Issue Type: Bug
Components: HttpClient
Affects Versions: 3.1 Beta 1
Environment: Solaris 10 SPARC, JDK 1.5.0_10
Reporter: Anthony Bigbee
Priority: Critical
Multithreaded app that uses MultiThreadedHttpConnectionManager and GetMethod is
exceeding MaxTotalConnections specified in MultiThreadedHttpConnectionManager.
Connections may be unncessarily created instead of reused, but I do not know if
this is the case or whether the MaxTotalConnections is not being honored as the
cause of this behavior.
netstat reveals that the number of http TIME_WAIT state sockets exceeds
MaxTotalConnections after a short time period for a small number of threads /
GetMethod objects. The threads with the GetMethod objects *are* invoking
GetMethod.releaseConnection().
This behavior is reproducible every time.
Relevant code snippets below:
httpConnectionManagerParams.setMaxTotalConnections(MAXCONNECTIONS);
//MAXCONNECTIONS = 50 for testing
this.connectionManager = new MultiThreadedHttpConnectionManager();
this.connectionManager.setParams(httpConnectionManagerParams);
this.httpClient = new HttpClient(this.connectionManager);
this.httpClient.getParams().setParameter("http.useragent", "Internet Explorer
6.x");
this.httpClient.getParams().setParameter("http.protocol.version",
HttpVersion.HTTP_1_1);
this.httpClient.getParams().setParameter("http.connection-manager.max-total",
MAXCONNECTIONS);
this.httpClient.getParams().setParameter("http.connection.stalecheck", true);
this.httpClient.getParams().setParameter("http.connection-manager.max-per-host",
MAXCONNECTIONSPERHOST);
This bug is reproducible every time.
AJB
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]