On Mon, 7 Jan 2002, Ryan Bloom wrote:
> On Monday 07 January 2002 10:48 am, Sander van Zoest wrote:
> > So, you are saying that I can create an apache httpd daemon where it would never
>make a
> > stat(2) in the default DocumentRoot directory?
> > If so, let me know how, because that would be really useful.
> If the modules are implemented correctly, that should just happen with:
> <Location /foo/nostat>
> SetHandler PerlHandler
> </Location>
Okay with 2.0.28 beta (on FreeBSD 4.4-RELEASE), I have the following config (rest
defaults):
DocumentRoot "/var/tmp/nostats/here"
<Location /foo/nostat>
SetHandler server-status
</Location>
I count around 6 stat() calls for this single request in regards to DocumentRoot.
Here is my ktrace of a request to /foo/nostat:
---
<snip>
14977 httpd CALL select(0x9,0xbfbfd15c,0,0,0xbfbfd154)
14977 httpd RET select 1
14977 httpd CALL read(0x8,0x8122000,0x2000)
14977 httpd GIO fd 8 read 444 bytes
"GET /foo/nostat HTTP/1.1\r
Host: localhost\r
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:0.9.7) Gecko/\
20011222\r
Accept: text/xml, application/xml, application/xhtml+xml, text/html;q=\
0.9, image/png, image/jpeg, image/gif;q=0.2, text/plain;q=0.8, text/cs\
s, */*;q=0.1\r
Accept-Language: en-us\r
Accept-Encoding: gzip, deflate, compress;q=0.9\r
Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66\r
Keep-Alive: 300\r
Connection: keep-alive\r
\r
"
14977 httpd RET read 444/0x1bc
14977 httpd CALL break(0x8174000)
14977 httpd RET break 0
14977 httpd CALL gettimeofday(0xbfbfd344,0)
14977 httpd RET gettimeofday 0
14977 httpd CALL stat(0x8124dac,0xbfbff1dc)
14977 httpd NAMI "/var/tmp/nostats/here/foo/nostat"
14977 httpd RET stat -1 errno 2 No such file or directory
14977 httpd CALL lstat(0x8124e6c,0xbfbff1ac)
14977 httpd NAMI "/var"
14977 httpd RET lstat 0
14977 httpd CALL lstat(0x8124e6c,0xbfbff1ac)
14977 httpd NAMI "/var/tmp"
14977 httpd RET lstat 0
14977 httpd CALL lstat(0x8124e6c,0xbfbff1ac)
14977 httpd NAMI "/var/tmp/nostats"
14977 httpd RET lstat 0
14977 httpd CALL lstat(0x8124e6c,0xbfbff1ac)
14977 httpd NAMI "/var/tmp/nostats/here"
14977 httpd RET lstat 0
14977 httpd CALL lstat(0x8124e6c,0xbfbff1ac)
14977 httpd NAMI "/var/tmp/nostats/here/foo"
14977 httpd RET lstat -1 errno 2 No such file or directory
14977 httpd CALL gettimeofday(0xbfbfcc44,0)
14977 httpd RET gettimeofday 0
14977 httpd CALL break(0x8176000)
14977 httpd RET break 0
14977 httpd CALL break(0x8178000)
14977 httpd RET break 0
14977 httpd CALL issetugid
14977 httpd RET issetugid 1
14977 httpd CALL open(0xbfbfea78,0,0x280a6167)
14977 httpd NAMI "/usr/share/zoneinfo/GMT"
14977 httpd RET open 9
14977 httpd CALL fstat(0x9,0xbfbfee7c)
14977 httpd RET fstat 0
14977 httpd CALL read(0x9,0xbfbfcb70,0x1f08)
14977 httpd GIO fd 9 read 56 bytes
"TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\^A\0\0\0\^A\0\0\0\0\0\0\0\0\
\0\0\0\^A\0\0\0\^D\0\0\0\0\0\0GMT\0\0\0"
14977 httpd RET read 56/0x38
14977 httpd CALL close(0x9)
14977 httpd RET close 0
14977 httpd CALL break(0x817a000)
14977 httpd RET break 0
14977 httpd CALL read(0x8,0x8122000,0x2000)
14977 httpd RET read -1 errno 35 Resource temporarily unavailable
14977 httpd CALL writev(0x8,0xbfbff2ac,0x1)
14977 httpd GIO fd 8 wrote 1812 bytes
"HTTP/1.1 200 OK\r
Date: Mon, 07 Jan 2002 19:12:41 GMT\r
Server: Apache/2.0.28 (Unix)\r
Content-Length: 1602\r
Keep-Alive: timeout=15, max=100\r
Connection: Keep-Alive\r
Content-Type: text/html; charset=ISO-8859-1\r
\r
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html><head>
<title>Apache Status</title>
</head><body>
<h1>Apache Server Status for escher.san.yahoo.com</h1>
<dl><dt>Server Version: Apache/2.0.28 (Unix)</dt>
<dt>Server Built: Jan 7 2002 11:04:35
</dt></dl><hr /><dl>
<dt>Current Time: Monday, 07-Jan-2002 11:12:41 PST</dt>
<dt>Restart Time: Monday, 07-Jan-2002 11:12:20 PST</dt>
<dt>Parent Server Generation: 0</dt>
<dt>Server uptime: 20 seconds</dt>
<dt>0 requests currently being processed, 0 idle workers</dt>
</dl><pre>W...........................................................\
....
................................................................
................................................................
................................................................
</pre>
<p>Scoreboard Key:<br />
"<b><code>_</code></b>" Waiting for Connection,
"<b><code>S</code></b>" Starting up,
"<b><code>R</code></b>" Reading Request,<br />
"<b><code>W</code></b>" Sending Reply,
"<b><code>K</code></b>" Keepalive (read),
"<b><code>D</code></b>" DNS Lookup,<br />
"<b><code>C</code></b>" Closing connection,
"<b><code>L</code></b>" Logging,
"<b><code>G</code></b>" Gracefully finishing,<br />
"<b><code>I</code></b>" Idle cleanup of worker,
"<b><code>.</code></b>" Open slot with no current process</p>
<p />
PID Key: <br />
<pre>
0 in state: W ,
</pre>
<hr />To obtain a full report with current status information you need\
to use the <code>ExtendedStatus On</code> directive.
<hr />
<address>Apache/2.0.28 Server at escher.san.yahoo.com Port 80</address\
>
</body></html>
"
14977 httpd RET writev 1812/0x714
14977 httpd CALL write(0x4,0x8125524,0x4f)
14977 httpd GIO fd 4 wrote 79 bytes
"127.0.0.1 - - [07/Jan/2002:11:12:41 -0800] "GET /foo/nostat HTTP/1.1" \
200 1602
"
14977 httpd RET write 79/0x4f
14977 httpd CALL read(0x8,0x8122000,0x2000)
14977 httpd RET read -1 errno 35 Resource temporarily unavailable
14977 httpd CALL select(0x9,0xbfbfd15c,0,0,0xbfbfd154)
14977 httpd PSIG SIGINT caught handler=0x80777f4 mask=0x0 code=0x0
14977 httpd RET select -1 errno 4 Interrupted system call
14977 httpd CALL close(0x8)
14977 httpd RET close 0
14977 httpd CALL close(0x6)
14977 httpd RET close 0
14977 httpd CALL close(0x5)
14977 httpd RET close 0
14977 httpd CALL sigprocmask(0x1,0x280b5b00,0xbfbfcea0)
14977 httpd RET sigprocmask 0
14977 httpd CALL sigprocmask(0x3,0x280b5b10,0)
14977 httpd RET sigprocmask 0
14977 httpd CALL exit(0)
---
Cheers,
--
Sander van Zoest [EMAIL PROTECTED]
High Geek http://Sander.vanZoest.com/