hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Timeout when sending on slow link
Date Mon, 28 Apr 2014 13:28:18 GMT
On Sat, 2014-04-26 at 19:52 +0000, Boxer, Aaron wrote:
> Hello List,
> 
> I am using the latest version of httpasynchclient to send six 13 MB files over a 10 MBPS
link.
> My timeout is set to 30 seconds, and I am getting timeout errors, in the following timeout
handler:
> 
>     protected void timeoutCheck(final SelectionKey key, final long now) {
>         final IOSessionImpl session = (IOSessionImpl) key.attachment();
>         if (session != null) {
>             final int timeout = session.getSocketTimeout();
>             if (timeout > 0) {
>                 if (session.getLastAccessTime() + timeout < now) {
>                     sessionTimedOut(session);
>                 }
>             }
>         }
>     }
> 
> Setting my timeout to 2 minutes fixes these timeout errors:
> 
>         IOReactorConfig ioReactorConfig = IOReactorConfig.custom()
>                 .setIoThreadCount(Runtime.getRuntime().availableProcessors())
>                 .setConnectTimeout(120000)
>                 .setSoTimeout(120000)
>                 .setTcpNoDelay(true)
>                 .build();
> 
> 
> Is this reasonable to get timeout errors with a 30 second timeout?
> Is there anything else I can configure to prevent a timeout?
> 
> 
> Over 10 MBPS, each file should take about 15 seconds to send. But, since all files are
being sent asynchronously,
> is it true that each file may take a lot longer to send, since there are other concurrent
sockets active?
> 
> Thanks very much,
> Aaron

Hi Aaron

I think it is conceivable that a particular connection may get no i/o
activity for a considerable period of time on a slow link with a high
concurrency level. I do admit that 30 seconds sound a bit too extreme,
so it can also be a defect in the I/O reactor layer. 

You might want to run your application with I/O event logging on and
analyze i/o activity of a particular connection.

Oleg  



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message