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] [Comment Edited] (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 11:47:05 GMT

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

Henri Gomez edited comment on HTTPCLIENT-1518 at 7/17/14 11:45 AM:
-------------------------------------------------------------------

About remote servers.

I did a netstat and they have no more connections from Nexus server.
On their side, connections have been closed.

I put Nexus on hold for almost 4h and connections where still there after 4h.

Remote servers are Artifactory and Nexus behind Apache HTTPd. 
I'm using mod_jk in HTTPd to relay requests between HTTPd and Artifactory/Nexus.

On HTTPd : 

{code}
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MaxKeepAliveRequests 100
{code}

It's consistent with what I get in HTTP headers :

{code}
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:20
Content-Type:text/plain
Date:Thu, 17 Jul 2014 11:44:27 GMT
Keep-Alive:timeout=15, max=100
{code}




was (Author: hgomez):
About remote servers.

I did a netstat and they have no more connections from Nexus server.
On their side, connections has been closed.

I put Nexus on hold for almost 4h and connections where still there after 4h.

Remote servers are Artifactory and Nexus behind Apache HTTPd. 
I'm using mod_jk in HTTPd to relay requests between HTTPd and Artifactory/Nexus.

On HTTPd : 

{code}
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MaxKeepAliveRequests 100
{code}

It's consistent with what I get in HTTP headers :

{code}
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:20
Content-Type:text/plain
Date:Thu, 17 Jul 2014 11:44:27 GMT
Keep-Alive:timeout=15, max=100
{code}



> 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