Return-Path: Delivered-To: apmail-jakarta-httpcomponents-dev-archive@www.apache.org Received: (qmail 93797 invoked from network); 19 Jan 2007 05:19:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jan 2007 05:19:51 -0000 Received: (qmail 3440 invoked by uid 500); 19 Jan 2007 05:19:57 -0000 Delivered-To: apmail-jakarta-httpcomponents-dev-archive@jakarta.apache.org Received: (qmail 3429 invoked by uid 500); 19 Jan 2007 05:19:57 -0000 Mailing-List: contact httpcomponents-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list httpcomponents-dev@jakarta.apache.org Received: (qmail 3420 invoked by uid 99); 19 Jan 2007 05:19:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jan 2007 21:19:57 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jan 2007 21:19:50 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id F22897141D1 for ; Thu, 18 Jan 2007 21:19:29 -0800 (PST) Message-ID: <701499.1169183969961.JavaMail.jira@brutus> Date: Thu, 18 Jan 2007 21:19:29 -0800 (PST) From: "Anthony Bigbee (JIRA)" To: httpcomponents-dev@jakarta.apache.org Subject: [jira] Commented: (HTTPCLIENT-623) MultiThreadedHttpConnectionManager exceeds MaxTotalConnections In-Reply-To: <31442008.1169072609983.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCLIENT-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465961 ] Anthony Bigbee commented on HTTPCLIENT-623: ------------------------------------------- TIME_WAIT state sockets exceeding MaxTotalConnections are an unnecessary use of system resources but I think can be avoided by calling Socket.setReuseAddress(true) immediately after socket creation (but before binding). I request a programmatic way to do it via the connection parameters and consideration of doing this action by default. > 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: httpcomponents-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org