hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Gomez (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1518) In 4.3.2/3 (running on Sun Solaris 10) during stress test connections go in close_wait
Date Thu, 17 Jul 2014 10:28:04 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14064783#comment-14064783
] 

Henri Gomez commented on HTTPCLIENT-1518:
-----------------------------------------

I had a discussion with Sonatype team about Nexus and HC.
They are using eviction thread [1] and use an HC4 Provider [2]

I activated log and evicting thread run each 5s.

I rerouted traffic to another Nexus so there was no activity on its side.

ThreadDump and HeadDump reported a single HC Client in whole heap but system reported 30 connections
in CLOSE_WAIT.

That's why I said I'm faced a similar issue, in a similar situation (Tomcat 7 with Java 7),
while running on a different OS (Linux instead of Solaris).
I would be happy to bring more informations next time (I had to restart Nexus) but would need
more information on what to search for at JVM level, using TD and HD.
   

[1] https://github.com/sonatype/nexus-oss/blob/nexus-2.8.x/components/nexus-core/src/main/java/org/sonatype/nexus/apachehttpclient/EvictingThread.java
[2] https://github.com/sonatype/nexus-oss/blob/nexus-2.8.x/components/nexus-core/src/main/java/org/sonatype/nexus/apachehttpclient/Hc4ProviderImpl.java

> In 4.3.2/3 (running on Sun Solaris 10) during stress test connections go in close_wait
> --------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1518
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1518
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.3.2, 4.3.3
>            Reporter: stefano gristina
>            Priority: Critical
>
> Httplclient used is 4.3.2/3  inside servlet under tomcat 7 (jre 7). SO: Sun Solaris 10.
> During stress test (after some hour)TCP  connections to server go in close_wait. 
> bash-3.2$ netstat -an |grep 8010| grep CLOSE_WAIT        
> 10.199.139.13.37055  10.199.139.1.8010     8760      0 49640      0 CLOSE_WAIT
> 10.199.139.13.37145  10.199.139.1.8010     8760      0 49640      0 CLOSE_WAIT
> 10.199.139.13.37140  10.199.139.1.8010     8760      0 49640      0 CLOSE_WAIT
> 10.199.139.13.37109  10.199.139.1.8010     8760      0 49640      0 CLOSE_WAIT
> 10.199.139.13.36798  10.199.139.1.8010     8760      0 49640      0 CLOSE_WAIT
> 10.199.139.13.37226  10.199.139.1.8010     8760      0 49640      0 CLOSE_WAIT
> One only connection is active at the end. With one only TCP connection the performances
are very low. Work around is to restart Tomcat.
> Behaviour not acceptable.
> The class IdleConnectionMonitorThread is used to close idle and expired tcp connections:
not real effect.
> Issue solved using httpclient 3.0.1.
> Snippet of code:
> init()
> public void init(ServletConfig config) throws ServletException {
> cm = new PoolingHttpClientConnectionManager();
> 			cm.setDefaultMaxPerRoute(numOfConnectionTOADC);
> 			// HttpClient client = new DefaultHttpClient(cm);
> 			RequestConfig defaultRequestConfig = RequestConfig.custom()
> 					.setSocketTimeout(socketTimeoutADC)
> 					.setConnectTimeout(connectionTimeoutADC).build();
> 			client = HttpClients.custom().setConnectionManager(cm).build();
> 			idleConn=new IdleConnectionMonitorThread(cm);
> 			idleConn.start();
> }
> protected void doGet(){
> CloseableHttpResponse respon;
> 				try {
> 					respon = client.execute(req, context);
> 				}
> 				catch (Exception e) {
> 					
> 				}
> 				finally {
> 					respon.close();
> 					req.releaseConnection();
> 				}
> }



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message