You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Evan Swanson <Ev...@gmd.fujitsu.com> on 2001/11/14 02:30:47 UTC

proxy server time outs

I have an application that queries a very large database. 
It takes a long time but there does not seem to be anyway around that.
This all works fine until I use it with a proxy server. 

The proxy server times out because there is such a slow response.

Is there any way to tell the proxy server "Hold on, its comming"?


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: proxy server time outs

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 13 Nov 2001, Tom Drake wrote:

> Date: Tue, 13 Nov 2001 18:11:04 -0800
> From: Tom Drake <rt...@pobox.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>,
>      Tom Drake <rt...@pobox.com>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Re: proxy server time outs
>
> Depending on the proxy server, there may be a configurable
> time-out.
>
> Your web-application should spit back the HTTP header and
> the beginning of your HTML document before you start the query.
> Make sure to flush the output stream.
>
> If this is not enough, and you are producing an HTML response,
> you could launch a thread in your servlet that
> kicks out a space ' ' to the servlet output stream every so often.
> When your query finally completes, do whatever is necessary
> to stop the thread, then close the output stream and return.
>

One approach that is common on long-running queries is to run them in an
independent thread on the server, and then create an initial response page
that says "Processing ... please wait".  At the top of the page, use a
meta tag to automatically refresh every ten seconds or so.

As each request comes in, the servlet checks if the query is complete yet.
If it's still running, return a "Still processing ..." page.  If it's
done, send the resulting report.

Of course, there are some much better options (IMHO):

* Redesign your application's queries so that they need to gather
  less information at a time, and are thus less prone to timeout.
  If you're having to retrieve 1000 rows for a big report, design
  things so that you can paginate the response 20 rows at a time.
  Users are *much* less likely to cancel and go elsewhere when the
  system is more responsive in this way.

* Work with your database administrator (DBA) to fine-tune the actual
  queries you are using to retrieve information.  I've seen 100x
  (two orders of magnitude) improvements in query response time from
  simple changes in the selection criteria, and/or additions of
  appropriate indexes to the database.

Craig McClanahan


>
> ----- Original Message -----
> From: "Evan Swanson" <Ev...@gmd.fujitsu.com>
> To: "'Tomcat Users List'" <to...@jakarta.apache.org>
> Sent: Tuesday, November 13, 2001 5:30 PM
> Subject: proxy server time outs
>
>
> | I have an application that queries a very large database.
> | It takes a long time but there does not seem to be anyway around that.
> | This all works fine until I use it with a proxy server.
> |
> | The proxy server times out because there is such a slow response.
> |
> | Is there any way to tell the proxy server "Hold on, its comming"?
> |
> |
> | --
> | To unsubscribe:   <ma...@jakarta.apache.org>
> | For additional commands: <ma...@jakarta.apache.org>
> | Troubles with the list: <ma...@jakarta.apache.org>
> |
> |
> |
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: proxy server time outs

Posted by Tom Drake <rt...@pobox.com>.
Depending on the proxy server, there may be a configurable
time-out.

Your web-application should spit back the HTTP header and
the beginning of your HTML document before you start the query.
Make sure to flush the output stream.

If this is not enough, and you are producing an HTML response,
you could launch a thread in your servlet that 
kicks out a space ' ' to the servlet output stream every so often.
When your query finally completes, do whatever is necessary
to stop the thread, then close the output stream and return.


----- Original Message ----- 
From: "Evan Swanson" <Ev...@gmd.fujitsu.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Tuesday, November 13, 2001 5:30 PM
Subject: proxy server time outs


| I have an application that queries a very large database. 
| It takes a long time but there does not seem to be anyway around that.
| This all works fine until I use it with a proxy server. 
| 
| The proxy server times out because there is such a slow response.
| 
| Is there any way to tell the proxy server "Hold on, its comming"?
| 
| 
| --
| To unsubscribe:   <ma...@jakarta.apache.org>
| For additional commands: <ma...@jakarta.apache.org>
| Troubles with the list: <ma...@jakarta.apache.org>
| 
| 
| 


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>