My bad.. I pasted Ning client's initialization. Please find below Apache 
Httpclient initialization. 

PoolingClientAsyncConnectionManager connectionManager;
try {
    // Set up the scheme
    AsyncSchemeRegistry ymailRegistry = 
AsyncSchemeRegistryFactory.createDefault();
    DefaultConnectingIOReactor ioreactor = new DefaultConnectingIOReactor();
    connectionManager = new PoolingClientAsyncConnectionManager(ioreactor, 
ymailRegistry);
} catch (IOReactorException e) {
    throw new RuntimeException(e);
}
connectionManager.setDefaultMaxPerRoute(config.getMaxConnectionsPerService().intValue());

connectionManager.setMaxTotal(config.getMaxConnectionsTotal().intValue());

HttpAsyncClient client = new DefaultHttpAsyncClient(connectionManager);


Thanks


On Tuesday, April 9, 2013 7:06 PM, Jaikit Savla <[email protected]> 
wrote:
Hello, I am using Aysnc Httpclient with total of  12000 connections and 512 
connection per host. The client works fine for around 2 days and after that all 
the request fail with below exception.  Any one have any clue on how to debug 
this ? Looks like a leak of connections to me. Any suggestions, tips ?
    
    

        final AsyncHttpClient asyncClient = new AsyncHttpClient(
                new AsyncHttpClientConfig.Builder()
                .setCompressionEnabled(config.getCompressEnabled())
                .setConnectionTimeoutInMs(connectionTimeout)
                .setMaximumConnectionsPerHost(maxConnectionsPerService)
                .setMaximumConnectionsTotal(totalConnections).build());
        ShutdownHookSorter.INSTANCE.registerShutdownResource(
            new ShutdownResource( new Thread() {
                public void run() {
                     asyncClient.close();
                }
            }, -1.0 ) );


2013-04-10 00:35:52 Sender$HttpCallback [WARN] Failed Http request: POST 
http://xyz/ HTTP/1.1 : duration(MS): 50529
java.util.concurrent.TimeoutException
at 
org.apache.http.nio.pool.AbstractNIOConnPool.processPendingRequests(AbstractNIOConnPool.java:244)
at 
org.apache.http.nio.pool.AbstractNIOConnPool.lease(AbstractNIOConnPool.java:192)
at 
org.apache.http.impl.nio.conn.PoolingClientAsyncConnectionManager.leaseConnection(PoolingClientAsyncConnectionManager.java:176)
at 
org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.requestConnection(DefaultAsyncRequestDirector.java:629)
at 
org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.start(DefaultAsyncRequestDirector.java:233)
at 
org.apache.http.impl.nio.client.AbstractHttpAsyncClient.execute(AbstractHttpAsyncClient.java:540)
at 
org.apache.http.impl.nio.client.AbstractHttpAsyncClient.execute(AbstractHttpAsyncClient.java:554)
at 
org.apache.http.impl.nio.client.AbstractHttpAsyncClient.execute(AbstractHttpAsyncClient.java:584)
at 
org.apache.http.impl.nio.client.AbstractHttpAsyncClient.execute(AbstractHttpAsyncClient.java:569)
at com.yahoo.jedi.events.vespa.VespaSender.sendUpdate(VespaSender.java:59)
at 
com.yahoo.jedi.events.vespa.FlagEventListener.onMessage(FlagEventListener.java:101)
at 
org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1321)
at 
org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131)
at 
org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202)
at 
org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129)
at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

Thanks

Jaikit

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to