RE: TimeoutException in async pool
Thanks Oleg, is there anything I can do in the pool configuration to mitigate this effect? -Mensaje original- De: Oleg Kalnichevski [mailto:ol...@apache.org] Enviado el: lunes, 3 de octubre de 2016 21:32 Para: HttpClient User Discussion Asunto: Re: TimeoutException in async pool On Mon, 2016-10-03 at 10:45 +0200, Joan Balagueró wrote: > Thanks Stefan and yes, that's right. And I already told my client to modify > these settings. But I still have the doubt about why a Timeout exception in a > pool that has no upper limit in the number of pooled connections. > > This is because of the lock contention. Oleg > -Mensaje original- > De: Stefan Magnus Landrø [mailto:stefan.lan...@gmail.com] Enviado el: > lunes, 3 de octubre de 2016 9:00 > Para: HttpClient User Discussion > Asunto: Re: TimeoutException in async pool > > So - first I'd set pool size to 50 since that's all you need on average. Then > set acquisition timeout to something that makes sense. 10-20ms? > > Sendt fra min iPhone > > > Den 3. okt. 2016 kl. 07.32 skrev Joan Balagueró > > : > > > > Hello, > > > > I’m using the async PoolingNHttpClientConnectionManager (v 4.1.2). > > > > Occasionally I’m getting this error: > > > > java.util.concurrent.TimeoutException > >at > > org.apache.http.nio.pool.AbstractNIOConnPool.processPendingRequest(A > > bs > > tractN > > IOConnPool.java:364) > >at > > org.apache.http.nio.pool.AbstractNIOConnPool.lease(AbstractNIOConnPool.java: > > 276) > >at > > org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.re > > qu > > estCon > > nection(PoolingNHttpClientConnectionManager.java:266) > >at > > org.apache.http.impl.nio.client.AbstractClientExchangeHandler.reques > > tC > > onnect > > ion(AbstractClientExchangeHandler.java:363) > >at > > org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.sta > > rt > > (Defau > > ltClientExchangeHandlerImpl.java:125) > >at > > org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(Inte > > rn > > alHttp > > AsyncClient.java:141) > >at > > org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(Clo > > se > > ableHt > > tpAsyncClient.java:68) > > > > > > It seems that all connections in pool are busy. But my setup says: > > > > this.phccm = new PoolingNHttpClientConnectionManager(…); > > this.phccm.setMaxTotal(Integer.MAX_VALUE); > > this.phccm.setDefaultMaxPerRoute(Integer.MAX_VALUE); > > > > > > I don't have more than 1000 requests per second, and the average > > response time is less than 20ms. > > > > What could be the reason for this error? > > > > Thanks, > > Joan. > > > > > > > > - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org > > For additional commands, e-mail: httpclient-users-h...@hc.apache.org > > > > > - > To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org > For additional commands, e-mail: httpclient-users-h...@hc.apache.org > - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Re: TimeoutException in async pool
On Mon, 2016-10-03 at 10:45 +0200, Joan Balagueró wrote: > Thanks Stefan and yes, that's right. And I already told my client to modify > these settings. But I still have the doubt about why a Timeout exception in a > pool that has no upper limit in the number of pooled connections. > > This is because of the lock contention. Oleg > -Mensaje original- > De: Stefan Magnus Landrø [mailto:stefan.lan...@gmail.com] > Enviado el: lunes, 3 de octubre de 2016 9:00 > Para: HttpClient User Discussion > Asunto: Re: TimeoutException in async pool > > So - first I'd set pool size to 50 since that's all you need on average. Then > set acquisition timeout to something that makes sense. 10-20ms? > > Sendt fra min iPhone > > > Den 3. okt. 2016 kl. 07.32 skrev Joan Balagueró > > : > > > > Hello, > > > > I’m using the async PoolingNHttpClientConnectionManager (v 4.1.2). > > > > Occasionally I’m getting this error: > > > > java.util.concurrent.TimeoutException > >at > > org.apache.http.nio.pool.AbstractNIOConnPool.processPendingRequest(Abs > > tractN > > IOConnPool.java:364) > >at > > org.apache.http.nio.pool.AbstractNIOConnPool.lease(AbstractNIOConnPool.java: > > 276) > >at > > org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.requ > > estCon > > nection(PoolingNHttpClientConnectionManager.java:266) > >at > > org.apache.http.impl.nio.client.AbstractClientExchangeHandler.requestC > > onnect > > ion(AbstractClientExchangeHandler.java:363) > >at > > org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.start > > (Defau > > ltClientExchangeHandlerImpl.java:125) > >at > > org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(Intern > > alHttp > > AsyncClient.java:141) > >at > > org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(Close > > ableHt > > tpAsyncClient.java:68) > > > > > > It seems that all connections in pool are busy. But my setup says: > > > > this.phccm = new PoolingNHttpClientConnectionManager(…); > > this.phccm.setMaxTotal(Integer.MAX_VALUE); > > this.phccm.setDefaultMaxPerRoute(Integer.MAX_VALUE); > > > > > > I don't have more than 1000 requests per second, and the average > > response time is less than 20ms. > > > > What could be the reason for this error? > > > > Thanks, > > Joan. > > > > > > - > > To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org > > For additional commands, e-mail: httpclient-users-h...@hc.apache.org > > > > > - > To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org > For additional commands, e-mail: httpclient-users-h...@hc.apache.org > - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
RE: TimeoutException in async pool
Thanks Stefan and yes, that's right. And I already told my client to modify these settings. But I still have the doubt about why a Timeout exception in a pool that has no upper limit in the number of pooled connections. -Mensaje original- De: Stefan Magnus Landrø [mailto:stefan.lan...@gmail.com] Enviado el: lunes, 3 de octubre de 2016 9:00 Para: HttpClient User Discussion Asunto: Re: TimeoutException in async pool So - first I'd set pool size to 50 since that's all you need on average. Then set acquisition timeout to something that makes sense. 10-20ms? Sendt fra min iPhone > Den 3. okt. 2016 kl. 07.32 skrev Joan Balagueró > : > > Hello, > > I’m using the async PoolingNHttpClientConnectionManager (v 4.1.2). > > Occasionally I’m getting this error: > > java.util.concurrent.TimeoutException >at > org.apache.http.nio.pool.AbstractNIOConnPool.processPendingRequest(Abs > tractN > IOConnPool.java:364) >at > org.apache.http.nio.pool.AbstractNIOConnPool.lease(AbstractNIOConnPool.java: > 276) >at > org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.requ > estCon > nection(PoolingNHttpClientConnectionManager.java:266) >at > org.apache.http.impl.nio.client.AbstractClientExchangeHandler.requestC > onnect > ion(AbstractClientExchangeHandler.java:363) >at > org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.start > (Defau > ltClientExchangeHandlerImpl.java:125) >at > org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(Intern > alHttp > AsyncClient.java:141) >at > org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(Close > ableHt > tpAsyncClient.java:68) > > > It seems that all connections in pool are busy. But my setup says: > > this.phccm = new PoolingNHttpClientConnectionManager(…); > this.phccm.setMaxTotal(Integer.MAX_VALUE); > this.phccm.setDefaultMaxPerRoute(Integer.MAX_VALUE); > > > I don't have more than 1000 requests per second, and the average > response time is less than 20ms. > > What could be the reason for this error? > > Thanks, > Joan. > > > - > To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org > For additional commands, e-mail: httpclient-users-h...@hc.apache.org > - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Re: TimeoutException in async pool
So - first I'd set pool size to 50 since that's all you need on average. Then set acquisition timeout to something that makes sense. 10-20ms? Sendt fra min iPhone > Den 3. okt. 2016 kl. 07.32 skrev Joan Balagueró > : > > Hello, > > I’m using the async PoolingNHttpClientConnectionManager (v 4.1.2). > > Occasionally I’m getting this error: > > java.util.concurrent.TimeoutException >at > org.apache.http.nio.pool.AbstractNIOConnPool.processPendingRequest(AbstractN > IOConnPool.java:364) >at > org.apache.http.nio.pool.AbstractNIOConnPool.lease(AbstractNIOConnPool.java: > 276) >at > org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.requestCon > nection(PoolingNHttpClientConnectionManager.java:266) >at > org.apache.http.impl.nio.client.AbstractClientExchangeHandler.requestConnect > ion(AbstractClientExchangeHandler.java:363) >at > org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.start(Defau > ltClientExchangeHandlerImpl.java:125) >at > org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttp > AsyncClient.java:141) >at > org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHt > tpAsyncClient.java:68) > > > It seems that all connections in pool are busy. But my setup says: > > this.phccm = new PoolingNHttpClientConnectionManager(…); > this.phccm.setMaxTotal(Integer.MAX_VALUE); > this.phccm.setDefaultMaxPerRoute(Integer.MAX_VALUE); > > > I don't have more than 1000 requests per second, and the average response > time is less than 20ms. > > What could be the reason for this error? > > Thanks, > Joan. > > > - > To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org > For additional commands, e-mail: httpclient-users-h...@hc.apache.org >
TimeoutException in async pool
Hello, Im using the async PoolingNHttpClientConnectionManager (v 4.1.2). Occasionally Im getting this error: java.util.concurrent.TimeoutException at org.apache.http.nio.pool.AbstractNIOConnPool.processPendingRequest(AbstractN IOConnPool.java:364) at org.apache.http.nio.pool.AbstractNIOConnPool.lease(AbstractNIOConnPool.java: 276) at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.requestCon nection(PoolingNHttpClientConnectionManager.java:266) at org.apache.http.impl.nio.client.AbstractClientExchangeHandler.requestConnect ion(AbstractClientExchangeHandler.java:363) at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.start(Defau ltClientExchangeHandlerImpl.java:125) at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttp AsyncClient.java:141) at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHt tpAsyncClient.java:68) It seems that all connections in pool are busy. But my setup says: this.phccm = new PoolingNHttpClientConnectionManager( ); this.phccm.setMaxTotal(Integer.MAX_VALUE); this.phccm.setDefaultMaxPerRoute(Integer.MAX_VALUE); I don't have more than 1000 requests per second, and the average response time is less than 20ms. What could be the reason for this error? Thanks, Joan. - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org