You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by srihari na <na...@gmail.com> on 2014/04/11 14:34:54 UTC

HTTP Client timeout

Hi All,

We are using Apache HTTP client 4.2.5 and we have both connection and
sockettimeout set. All the requests are passed via proxy (Apache HTTPD).
During peak loads in our production environments one of the proxy became
unresponsive. All the requests passing via that proxy had 3 states:
1. Some of them got socket timeout
2. some of the requests were hung and never came out
3. After long time we got connection timeouts

Our area of concern is 2nd state where some of the threads are hung and
never timeout. Now from my understanding connection timeout is the max time
period between connection request obtaining connection and socket timeout
is the max time of inactivity between any data packets. I wonder the 2nd
state requests have obtained the connection and was not able to send its
fist data packet. can anybody suggest if my think approach is in right
direction. If so how can we timeout such intermediate requests. If not any
reason why could these go into infinitely hung state.

-- 
Regards,
Srihari NA

Re: HTTP Client timeout

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2014-04-11 at 18:04 +0530, srihari na wrote:
> Hi All,
> 
> We are using Apache HTTP client 4.2.5 and we have both connection and
> sockettimeout set. All the requests are passed via proxy (Apache HTTPD).
> During peak loads in our production environments one of the proxy became
> unresponsive. All the requests passing via that proxy had 3 states:
> 1. Some of them got socket timeout
> 2. some of the requests were hung and never came out
> 3. After long time we got connection timeouts
> 
> Our area of concern is 2nd state where some of the threads are hung and
> never timeout. Now from my understanding connection timeout is the max time
> period between connection request obtaining connection and socket timeout
> is the max time of inactivity between any data packets. I wonder the 2nd
> state requests have obtained the connection and was not able to send its
> fist data packet. can anybody suggest if my think approach is in right
> direction. If so how can we timeout such intermediate requests. If not any
> reason why could these go into infinitely hung state.
> 

The thing is, if the server keeps on sending a few packets every once in
a while, the socket may never timeout and requests may appear hanging.
You should investigate if the server continues sending data when under
load and if so, try to reduce the socket timeout value.

Oleg



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