httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: On avoiding stat()
Date Thu, 18 Dec 1997 20:45:49 GMT
You're ignoring files which are automatically updated by external
processes -- which is the norm for all the large servers I deal with.  The
files are created on an internal host, then mirrored to N webservers via
rdist or rsync.

At any rate, no, there's no way to get rid of the stat().  It's all tied
up with how apache decides that your module will handle the request.  A
possible future optimization would be a 5 or 10 second stat() cache in
multithreaded servers.

Dean

On Thu, 18 Dec 1997, Igor Tatarinov wrote:

> If the author of the page requests it, it will be reloaded and I should 
> be able to detect it. If somebody else requests a stale page, it can 
> send a stale copy (this assumes I do stat the file every once in a while, 
> say every 30 min).
> 
> In fact, this means that I will never have  a stale copy if the author 
> takes a look at the final version of his/her masterpiece. And this is
> typically the case, I'd guess.
> 
> am I missing something?
> igor
> 
> Dean Gaudet wrote:
> > 
> > You need to stat() the file regardless.  How else do you determine if the
> > file in your cache is stale?  Even on non-IMS requests you need to stat().
> > Otherwise you have to implement full HTTP/1.1 proxy semantics, which is
> > non-trivial and not worth saving the stat() call imho.
> > 
> > Dean
> > 
> > On Thu, 18 Dec 1997, Igor Tatarinov wrote:
> > 
> > > Hi all!
> > >
> > > As you might remember, I am trying to add a document cache to apache that
> > > would (hopefully) decrease the number of I/Os and save some CPU cycles by
> > > avoiding open/mmap/close
> > >
> > > So I got a question: is there any way to avoid the stat() call. I know that
> > > Apache needs to make it to mmap the file but if I already got the file in
> > > the cache and know its size, there is no reason to stat() the file. Of
> > > course, the file may have been updated but this happens not often and I
> > > could probably check for "If-Modified-Since" and stat the file only if
> > > reload was requested.
> > >
> > > any ideas?
> > >
> > > thanks,
> > > igor
> > >
> > > --
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > Igor Tatarinov, graduate student, Computer Science Dept, NDSU
> > > e-mail: tatarino@prairie.nodak.edu   or   itat@acm.org
> > > http://www.cs.ndsu.nodak.edu/~tatarino
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >
> 
> -- 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Igor Tatarinov, graduate student, Computer Science Dept, NDSU
> e-mail: tatarino@prairie.nodak.edu   or   itat@acm.org
> http://www.cs.ndsu.nodak.edu/~tatarino
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 


Mime
View raw message