tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <smithh032...@gmail.com>
Subject Re: Avoiding/Handling SocketTimeoutException(s) when web application serving resources to mobile clients
Date Mon, 11 Nov 2013 00:22:03 GMT
On Sun, Nov 10, 2013 at 5:08 PM, Igor Cicimov <icicimov@gmail.com> wrote:

> For Sun Java for example you can try the following:
>
> -Dsun.net.client.defaultReadTimeout=1800000
>
> which will increase the socket timeout to 30 minutes lets say if the
> default one is not enough in case or slow client. Another thing to check is
> your OS socket timeout setting, on linux systems for example:
>
> net.ipv4.tcp_keepalive_time = 300
>
> and try adjusting it according to your needs.
>
> Would love to hear some other people experiences and thoughts regarding
> this as well, this is really annoying one to troubleshoot.
>

I like the following that was mentioned in a stackoverflow answer[1]:

> It just means the client isn't sending. You don't need to worry about it.
Browser clients come and go in all sorts of strange ways.

> I wouldn't put the server read timeout too high: it ties up a thread. If
a client opens a connection to the server and doesn't send anything
immediately it is misbehaving pretty badly.

I agree with all of that and based on that, I will not modify the NIO
connectiontimeout value. I would like to prevent the stacktrace from being
logged in tomcat7-stderr log file, so I think I will catch the exception in
my servlet filter.


[1] http://stackoverflow.com/a/17079991/933054

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message