httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zac Stevens <>
Subject Re: [users@httpd] single log file for multiple virtual hosts - another question
Date Wed, 13 Aug 2003 16:46:57 GMT
On Wed, Aug 13, 2003 at 09:13:36AM -0700, Jeremy Hansen wrote:
> So if I use a pipe in CustomLog to have a script do the sorting on the fly 
> for me, is this still better then just using a CustomLog directive per 
> virtual host?  If it sorted on the fly to seperate log files, isn't this 
> the same as just opening all those file handles to begin with?  I'm just 
> trying to figure out the proper approach to actually save resources.  

While the data still has to end up in the same files one way or another,
there are a number of different ways to get it there.  As far as file
descriptors go, Apache will open one for each logfile on server startup and
hold it open for the lifetime of the process.  By using an external script
for splitting the logs, the webserver only needs to hold open a single file
descriptor for logging everything - leaving the rest free to be used in the
business of serving your webpages!

In addition to reducing the overhead on Apache, an external script can 
manage file descriptors dynamically - allowing it to scale to numbers of 
logfiles exceeding the max file descriptor limit on your system.

> Should I have everything log to a single file and process that file 
> outside of apache all together sorting based on %V in the first field of 
> the log?

That's one approach which will work fine.  Whether it is the right one for
you depends on the problem you're trying to solve - performance,
scalability, managability, something else?  Also, consider the requirements
your customers have for their logs.  Do they need to be available in real
time, or can they be generated with a periodic job?

When implementing this sort of system, also consider the potential for
combining other log processing functions such as reverse IP address lookups
and statistic generation.



The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message