471,342 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,342 software developers and data experts.

Writing a CGI to query DB

Hi,

I am currently working on a CGI deployed on an Apache server, which,
given an arbitrary SQL, fetches raw data from a remote DB server and
return them in a HTML page. This CGI works fine on quick SQLs.

But when I try to run a slow SQL on this CGI, through a Squid Proxy, I
always get the Error message from Squid: Zero Sized Reply, after 5
minutes.

The SQL itself is correct, since I have tried it directly on the DB
server. So what do you think might cause the problem? Thank you.

Nov 10 '07 #1
4 1262
On Nov 9, 8:33 pm, Bighead <Xue.Huic...@gmail.comwrote:
Hi,

I am currently working on a CGI deployed on an Apache server, which,
given an arbitrary SQL, fetches raw data from a remote DB server and
return them in a HTML page. This CGI works fine on quick SQLs.

But when I try to run a slow SQL on this CGI, through a Squid Proxy, I
always get the Error message from Squid: Zero Sized Reply, after 5
minutes.

The SQL itself is correct, since I have tried it directly on the DB
server. So what do you think might cause the problem? Thank you.
Slow SQL = query that takes a long time? How long does the query take
if you run it on the same machine as the DB server without a Squid
Proxy?

Nov 10 '07 #2
On 10 Nov, 04:33, Bighead <Xue.Huic...@gmail.comwrote:
Hi,

I am currently working on a CGI deployed on an Apache server, which,
given an arbitrary SQL, fetches raw data from a remote DB server and
return them in a HTML page. This CGI works fine on quick SQLs.

But when I try to run a slow SQL on this CGI, through a Squid Proxy, I
always get the Error message from Squid: Zero Sized Reply, after 5
minutes.

The SQL itself is correct, since I have tried it directly on the DB
server. So what do you think might cause the problem? Thank you.
This sounds a lot like an apache server configuration problem. From
the squid FAQ;

11.51 Why do I sometimes get ``Zero Sized Reply''?

This happens when Squid makes a TCP connection to an origin server,
but for some reason, the connection is closed before Squid reads any
data. Depending on various factors, Squid may be able to retry the
request again. If you see the ``Zero Sized Reply'' error message, it
means that Squid was unable to retry, or that all retry attempts also
failed.

The apache server has a default TimeOut of 300 seconds.

This question might be more usefully answered by the apache user
group.

Regards, Paul Clinch

Nov 10 '07 #3
On Nov 10, 7:18 pm, TheFlyingDutchman <zzbba...@aol.comwrote:
On Nov 9, 8:33 pm, Bighead <Xue.Huic...@gmail.comwrote:
Hi,
I am currently working on a CGI deployed on an Apache server, which,
given an arbitrary SQL, fetches raw data from a remote DB server and
return them in a HTML page. This CGI works fine on quick SQLs.
But when I try to run a slow SQL on this CGI, through a Squid Proxy, I
always get the Error message from Squid: Zero Sized Reply, after 5
minutes.
The SQL itself is correct, since I have tried it directly on the DB
server. So what do you think might cause the problem? Thank you.

Slow SQL = query that takes a long time? How long does the query take
if you run it on the same machine as the DB server without a Squid
Proxy?

It takes 10 minutes to run this SQL. Squid's error message pops up in
about 5 minutes.

Nov 11 '07 #4
On Nov 11, 6:20 am, paulC <pcli...@gmail.comwrote:
On 10 Nov, 04:33, Bighead <Xue.Huic...@gmail.comwrote:
Hi,
I am currently working on a CGI deployed on an Apache server, which,
given an arbitrary SQL, fetches raw data from a remote DB server and
return them in a HTML page. This CGI works fine on quick SQLs.
But when I try to run a slow SQL on this CGI, through a Squid Proxy, I
always get the Error message from Squid: Zero Sized Reply, after 5
minutes.
The SQL itself is correct, since I have tried it directly on the DB
server. So what do you think might cause the problem? Thank you.

This sounds a lot like an apache server configuration problem. From
the squid FAQ;

11.51 Why do I sometimes get ``Zero Sized Reply''?

This happens when Squid makes a TCP connection to an origin server,
but for some reason, the connection is closed before Squid reads any
data. Depending on various factors, Squid may be able to retry the
request again. If you see the ``Zero Sized Reply'' error message, it
means that Squid was unable to retry, or that all retry attempts also
failed.

The apache server has a default TimeOut of 300 seconds.

This question might be more usefully answered by the apache user
group.

Regards, Paul Clinch

Thank you.
TimeOut of 300 seconds, does it mean that the connection will be
closed by remote Apache server if the server does not provide any data
in 300 seconds? So I can just let the server generate data
continuously, and the connection will not be cut off, right?

Nov 11 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by acdevteam | last post: by
16 posts views Thread by laverdir | last post: by
3 posts views Thread by Thorben Grosser | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.