httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <>
Subject Re: SGI Patch 10xpatch-2.0a6-2: Reduce time resolution to 1 sec
Date Mon, 26 Feb 2001 14:09:39 GMT

> > the performance bug is not the APR time representation -- it's the httpd
> > code which calls ap_now() for every single request and then does all
> > the module 10 arithmetic to format it into a Date: and log timestamp.
> >
> > the solution that all the performance winning webservers use is a
> > separate thread which wakes up once a second to generate new base-10
> > representations of the time.
> >
> > now that 2.0 has all the zero-copy machinery i think you've got what
> > you need to share the timestamp strings amongst multiple threads without
> > worrying about the safety issues.  (bill's suggested two buffer method
> > works fine unless you for some reason have a task sleep for 2 seconds...
> > such as when a system is under a hellish load.)
> No question about that, but my statement was serious: this implementation
> has demonstrated to be both more error-prone and slower than storing
> seconds as seconds.  I would fix it within APR because that makes better
> code available to all of the clients.  Even if we do fix it within httpd,
> my solution would be to stop using the APR time functions.

Not convinced we need anything other than a fine grained scaler to hold time.
Setting that discussion aside for a moment, any suggestions on how to do the
optimization to preformat the Date: timestamp and NOT call a system time
function for every request?   I only see this optimization being available on
a threaded MPM and implemented by the MPM itself. Should all requests to get
time go through the mpm (ap_mpm_time()) and the MPM can be configured to
either call apr_time() for each request, or it can implement a timer thread
that pops once per second and caches the results of apr_time() and preformats
a Date: string (which likewise needs an accessor function)? If the MPM is not
threaded, then this optimization is not done. Thoughts?


View raw message