axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Lyashko (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (AXIS2-4330) axis2 client machine has many CLOSE_WAIT tcp
Date Fri, 20 Nov 2009 04:14:39 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-4330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780426#action_12780426
] 

Oleg Lyashko edited comment on AXIS2-4330 at 11/20/09 4:13 AM:
---------------------------------------------------------------

Phil, Sai

> Right now for threads more than 2 we are encountering the following exception
> 19:41:57,785 INFO HTTPSender:202 - Unable to sendViaPost to url[http://localhost:8085/axis2/services/PAWS]
> org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout waiting for connection

I had the same problem. It seems that the source of it is defaultMaxConnectionsPerHost value
in MultiThreadedHttpConnectionManager equals 2. Workaround for me was to create own instance
of MultiThreadedHttpConnectionManager and use it in service stab, something like in example
below

    protected static void updateStub(org.apache.axis2.client.Stub stub, int maxTotal, int
maxPerHost) {
        MultiThreadedHttpConnectionManager httpConnectionManager = new MultiThreadedHttpConnectionManager();
        HttpConnectionManagerParams params = httpConnectionManager.getParams();
        if (params == null) {
            params = new HttpConnectionManagerParams();
            httpConnectionManager.setParams(params);
        }
        params.setMaxTotalConnections(maxTotal);
        params.setDefaultMaxConnectionsPerHost(maxPerHost);
        HttpClient httpClient = new HttpClient(httpConnectionManager);
        ServiceClient serviceClient = stub._getServiceClient();
        ConfigurationContext context = serviceClient.getServiceContext().getConfigurationContext();
        context.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
    }

Regards, Oleg


      was (Author: ovl):
    Phil, Sai

> Right now for threads more than 2 we are encountering the following exception
> 19:41:57,785 INFO HTTPSender:202 - Unable to sendViaPost to url[http://localhost:8085/axis2/services/PAWS]
> org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout waiting for connection

I had the same problem. It seems that the source of is defaultMaxConnectionsPerHost value
in MultiThreadedHttpConnectionManager is 2. Workaround for me was to create own instance of
MultiThreadedHttpConnectionManager and use it in service stab, something like in example below

    protected static void updateStub(org.apache.axis2.client.Stub stub, int maxTotal, int
maxPerHost) {
        MultiThreadedHttpConnectionManager httpConnectionManager = new MultiThreadedHttpConnectionManager();
        HttpConnectionManagerParams params = httpConnectionManager.getParams();
        if (params == null) {
            params = new HttpConnectionManagerParams();
            httpConnectionManager.setParams(params);
        }
        params.setMaxTotalConnections(maxTotal);
        params.setDefaultMaxConnectionsPerHost(maxPerHost);
        HttpClient httpClient = new HttpClient(httpConnectionManager);
        ServiceClient serviceClient = stub._getServiceClient();
        ConfigurationContext context = serviceClient.getServiceContext().getConfigurationContext();
        context.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
    }

Regards, Oleg

  
> axis2  client machine has many CLOSE_WAIT tcp
> ---------------------------------------------
>
>                 Key: AXIS2-4330
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4330
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.4.1
>         Environment: solaris
>            Reporter: jenny anderson
>             Fix For: 1.5.1
>
>         Attachments: TuxedoWebServiceStub.java
>
>
> My application is using axis2 web service. It  invokes web service thousand times per
second. We observed thousand CLOSE_WAIT connection after the application is run for less than
10 hours.  I checked even I set REUSE_HTTP_CLIENT to false, it still gets CLOSE_WAIT.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message