Strange delays

2000-07-03 Thread Eric Jain

Once in a while the first page being requested by a client is delayed
by approximately 10s, even though there is no significant load on the
server. Usual delays are between 0 and 1s, rarely up to 4s (complex
database queries).

Any Ideas where to look for the cause of this?

I first thought the problem might be with the database connections.
However these same delays also happen with pages, that don't need to
connect at all...


--
Eric Jain



httpd.conf
--

...
Timeout  300
KeepAliveOn
MaxKeepAliveRequests 100
KeepAliveTimeout 5
MinSpareServers  10
MaxSpareServers  20
StartServers 10
MaxClients   30
MaxRequestsPerChild  1000
...


startup.pl
--

use strict;

use Apache::GTopLimit;
$Apache::GTopLimit::MAX_PROCESS_SIZE = 15000;

require BioDoc::Page;
require BioDoc::SQL;

use DBI ();
DBI-install_driver("Pg");

use CGI ();
CGI-compile(':standard');

1;




Apache::DBI

2000-06-21 Thread Eric Jain

Is it be possible to modify Apache::DBI in sich a way that only
database connections specified in a PerlRequired startup.pl with
Apache::DBI-connect_on_init(...) are stored and all subsequent
DBI-connect(...) connections are properly established (if no matching
stored connection is available), but not stored afterwards? Or could
Apache::DBI::db::disconnect be changed, so it would actually
disconnect, except if it was handling one of the connect_on_init
connections?


--
Eric Jain




Logging response times

2000-06-13 Thread Eric Jain

I currently log "time - $r-request_time" in my PerlLogHandler.

This seems to works well, but I'm sure there is a better method, which
also is able to log more detailed than just in seconds...



--
Eric Jain




RE: PerlTransHandler and CGI.pm

2000-06-08 Thread Eric Jain

Got it... Seems like the query string is decoded twice: Therefore

http://biodoc.ch/de/search;query=%252Btest+%252Bdna+-xyz

works perfectly, since all the '%' are encoded. Then it even works
with slashes :-)


--
Eric Jain


 When processing the url
 http://biodoc.ch/de/search?query=%2Btest+%2Bdna+-xyz ,
 $cgi-param('query') correctly returns '+test +dna -xyz'.

 But if I use http://biodoc.ch/de/search;query=%2Btest+%2Bdna+-xyz
 instead, I get ' test  dna -xyz'. If I include a %3F (=?)
 in the url,
 I even get a 404 error. Slashes too only work if they are
 not encoded.

 There must be something wrong in my PerlTransHandler, approximatly
 here:

   my $uri = $r-uri();

   if ( my($u1,$u2) = $uri =~ / ^ ([^?]+?) ; ([^?]*) $ /x )
   {
   $r-uri($u1);
   $r-args($u2);
   }

 But what?

 --
 Eric Jain





PerlTransHandler and CGI.pm

2000-06-07 Thread Eric Jain

When processing the url
http://biodoc.ch/de/search?query=%2Btest+%2Bdna+-xyz ,
$cgi-param('query') correctly returns '+test +dna -xyz'.

But if I use http://biodoc.ch/de/search;query=%2Btest+%2Bdna+-xyz
instead, I get ' test  dna -xyz'. If I include a %3F (=?) in the url,
I even get a 404 error. Slashes too only work if they are not encoded.

There must be something wrong in my PerlTransHandler, approximatly
here:

my $uri = $r-uri();

if ( my($u1,$u2) = $uri =~ / ^ ([^?]+?) ; ([^?]*) $ /x )
{
$r-uri($u1);
$r-args($u2);
}

But what?

--
Eric Jain




RE: Cache control

2000-05-26 Thread Eric Jain

 The problem I have is that IE5 (and perhaps other browsers
 and versions)
 but NOT Netscape 4.x have absolutely no respect for cache-control.

IE5 can be set up to ignore any cache directives and keep a document
for either the duration of the session or forever. (Or reload it every
single time or check if it should be reloaded...)

This might be the cause of its respectlessness :-)


--
Eric Jain






Content negotiation headers

2000-05-07 Thread Eric Jain

How do I suppress content negotiation headers?

I am using my own handler to convert XML to HTML on the fly:

http://biodoc.ch/de/forum/2000/1/01.xml -

HTTP/1.1 200 OK
Date: Sun, 07 May 2000 20:40:52 GMT
Server: Apache/1.3.9 (Unix)  (SuSE/Linux) mod_perl/1.21 mod_ssl/2.4.7
OpenSSL/0.9.4
Connection: close
Content-Type: text/html

Perfect, except that I would like to hide the file ending. Enter
mod_negotiotion:

http://biodoc.ch/de/forum/2000/1/01 -

HTTP/1.1 200 OK
Date: Sun, 07 May 2000 20:40:21 GMT
Server: Apache/1.3.9 (Unix)  (SuSE/Linux) mod_perl/1.21 mod_ssl/2.4.7
OpenSSL/0.9.4
Content-Location: 01.xml
Vary: negotiate
TCN: choice
Connection: close
Content-Type: text/html

This will obviously not be cached by any proxies :-(

So how do I get rid of Content-Location, Vary and TCN?


--Eric Jain