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 Clemens Eisserer <li...@gmail.com> on 2007/07/29 17:37:28 UTC

Problem with slow servlet-response over Proxy

Hello,

I am experiencing problems fetching data from a busy-wait servlet over
a proxy (uses basic authetication).

The servlet looks more or less like:

byte[] payLoad;
Thread.sleep(2000);
response.write(payLoad);

So the response should take about 2s and then return the data -
however what it does is to abort after about ~80-200ms without any
data.
If I send a single byte before the wait I get the single byte - but I
never get the payload-data nore does the request take the full 2s.

Since it works without proxy and I also can fetch ordinary html-files
using exactly the same code over proxy I guess the proxy does kill my
request because no data is traveling home for too long time.

Could this be true? Had anybody else some experiences like this? How
did you solve it?

Thank you in advance, lg Clemens

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


Re: Problem with slow servlet-response over Proxy

Posted by Clemens Eisserer <li...@gmail.com>.
Hello again,

Thanks for all the suggestions, sending a dummy-byte every 10s solved
the problem - the additional "keep-alive"-data is still quite small.

Thanks a lot for your patience and help :-)

lg Clemens

2007/7/30, Clemens Eisserer <li...@gmail.com>:
> Hello Roland,
>
> > Yes. It's called a timeout. If you want to simulate a slow server,
> > you can send small pieces of the payload, for example a single byte,
> > every few milliseconds. Then the connection should not time out.
> Thanks a lot - I received the log-files today and you seem to be right
> - the proxy cuts the connection off exectly every 50ms.
> Can this really be true, I mean why should a proxy be configured with
> a 50ms timeout? I wonder how browsing can work with these strict
> values...
>
> Thanks a lot for your suggestion - I'll try a workarround sending
> 1byte every 10ms ... maybe this will help. Sad that this kills my
> not-busy-waiting approach ;)
>
> Thanks a lot, lg Clemens
>
> 2007/7/29, Roland Weber <os...@dubioso.net>:
> > Clemens Eisserer wrote:
> > > Since it works without proxy and I also can fetch ordinary html-files
> > > using exactly the same code over proxy I guess the proxy does kill my
> > > request because no data is traveling home for too long time.
> > >
> > > Could this be true?
> >
>

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


Re: Problem with slow servlet-response over Proxy

Posted by Clemens Eisserer <li...@gmail.com>.
Hello Roland,

> Yes. It's called a timeout. If you want to simulate a slow server,
> you can send small pieces of the payload, for example a single byte,
> every few milliseconds. Then the connection should not time out.
Thanks a lot - I received the log-files today and you seem to be right
- the proxy cuts the connection off exectly every 50ms.
Can this really be true, I mean why should a proxy be configured with
a 50ms timeout? I wonder how browsing can work with these strict
values...

Thanks a lot for your suggestion - I'll try a workarround sending
1byte every 10ms ... maybe this will help. Sad that this kills my
not-busy-waiting approach ;)

Thanks a lot, lg Clemens

2007/7/29, Roland Weber <os...@dubioso.net>:
> Clemens Eisserer wrote:
> > Since it works without proxy and I also can fetch ordinary html-files
> > using exactly the same code over proxy I guess the proxy does kill my
> > request because no data is traveling home for too long time.
> >
> > Could this be true?
>

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


Re: Problem with slow servlet-response over Proxy

Posted by Roland Weber <os...@dubioso.net>.
Clemens Eisserer wrote:
> Since it works without proxy and I also can fetch ordinary html-files
> using exactly the same code over proxy I guess the proxy does kill my
> request because no data is traveling home for too long time.
> 
> Could this be true?

Yes. It's called a timeout. If you want to simulate a slow server,
you can send small pieces of the payload, for example a single byte,
every few milliseconds. Then the connection should not time out.

hope that helps,
  Roland


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