axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asankha C. Perera" <>
Subject Re: [axis2] SimpleHTTPServer as transport listener causes too many connections to stay in TIME_WAIT state
Date Tue, 05 Feb 2008 18:10:53 GMT
> I did the following:
> - updated tomcat from 5.5 to 6.0.14
> - enabled and tuned the tomcat NIO connector
The above are ok - but does not affect the synapse-transports-1.1.1.jar 
at all...
> - upgraded the NIO listener and sender to synapse 1.1.1 (I had to 
> upgrade the http-core library from alpha5 to beta1)
> - enabled the NIO sender on the server side (as I said I have some 
> ServiceClient instances running on the server too)
> but it didn't fix the problem. Indeed, about 50% of the connections in 
> TIME_WAIT state are due to the tomcat connector and the other 50% to 
> the axis2 sender.
what do you mean "tomcat" connector? If you changed your axis2.xml to 
enable the o.a.synapse.transport.nhttp package, then *all* of your 
messages should only be handled by it and not by Tomcat anymore.. you 
cannot have a mix..
> So I enabled the NIO sender and NIO receiver on the client side.
> My scenario is composed by about 80% of asynchronous interactions and 
> 20% of very fast blocking in-out MEPs. Now the latter fail this way:
For optimal usage of server resources you should tune your OS (refer i.e. at a minimum;
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_fin_timeout = 30
fs.file-max = 2097152
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1

* soft nofile 4096
* hard nofile 65535

Also ensure you give enough heap to the Java process, and use HTTP 1.1 
and Keepalives as much as possible.
> ERROR 19:44:03,967 ( - Unable to add stream 
> for queue Service2
> ....
> The executed statements (related to axis2) are:
> final OMElement payload = createPayload();
> ServiceClient sender = new 
> ServiceClient(AddStreamConfiguration.getConfigurationContext(), null);
> sender.setOptions(getOptions());
> OMElement result = sender.sendReceive(payload);
> where the options are
> options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
> options.setCallTransportCleanup(true);
> options.setTo(StreamClient.getRouterEpr());
> options.setAction(TestConstants.ADD_STREAM_SOAP_ACTION);
> options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
> options.setProperty(HTTPConstants.CHUNKED, Boolean.TRUE);
> options.setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, Boolean.TRUE);
> and the configuration context differs from the default one because of 
> the http connection manager with cached http client.
I believe the above if for your client - and note that some of the above 
used properties does not apply to the NIO transport.. However, are you 
running your client and the server (and anything else related to the 
test scenario) on the same machine? If so, make sure that the culprit is 
not the client - I think the above code uses the default HTTP transport 
that uses the HttpClient codebase.. that may have properties for tuning 
which I am not fully familiar with..


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message