Apache: VHost logs and File Descriptors

Apache: VHost logs and File Descriptors

Post by John Ree » Wed, 02 Oct 2002 11:26:35



When generating apache logs for virtual hosts, is it preferable to log
everything to a single file and then parse it at fixed intervals (via cron
with split-logfile or similar), or is one access_log per virtual host
acceptable?

The apache docs talk about file descriptor limits, but according to my
/proc/sys/fs/file-max, I have a maximum of 8192 available. This seems like
enough to handle the 100 or so vhosts I plan on having on this box since
each access_log only consumes one descriptor. Perhaps I need to be concerned
about a per-process limit?

Currently, I'm logging everything to a single access_log, and rotating daily
via cronolog. Shortly after the rotation a cron job takes care of parsing
the log file and running the stats generation scripts for each vhost.

If it's not unreasonable, I'd like to be able to log each vhost separately
so that I could provide real-time stats if necessary. You know....
value-added and all.

The box is a P3, 1Ghz, 512MB RAM with Redhat 7.2 running apache 1.3.26. Any
insight would be appreciated.

John

 
 
 

Apache: VHost logs and File Descriptors

Post by 2Host.com - Rober » Wed, 02 Oct 2002 11:57:10



> When generating apache logs for virtual hosts, is it preferable to log
> everything to a single file and then parse it at fixed intervals (via cron
> with split-logfile or similar), or is one access_log per virtual host
> acceptable?

> The apache docs talk about file descriptor limits, but according to my
> /proc/sys/fs/file-max, I have a maximum of 8192 available. This seems like
> enough to handle the 100 or so vhosts I plan on having on this box since
> each access_log only consumes one descriptor. Perhaps I need to be concerned
> about a per-process limit?

> Currently, I'm logging everything to a single access_log, and rotating daily
> via cronolog. Shortly after the rotation a cron job takes care of parsing
> the log file and running the stats generation scripts for each vhost.

> If it's not unreasonable, I'd like to be able to log each vhost separately
> so that I could provide real-time stats if necessary. You know....
> value-added and all.

> The box is a P3, 1Ghz, 512MB RAM with Redhat 7.2 running apache 1.3.26. Any
> insight would be appreciated.

> John

It's best to have separate log files. You have a lot of vhosts to add
before hitting the FD limit (which you can raise, but that might not be
a good idea if it gets too bad), and it would take a more time to
process one log and pull out the different domains (if you have it set
up for that and want to have it report in that manner), than it would to
simply just have different log files and not worry about the FD limit,
because it's so high.
--
Regards,

Server admin, support & programing for shared & dedicated web servers
Secure, reliable hosting you expect and deserve! http://www.2host.com

 
 
 

1. Apache 1.3.3 log file rotation leaves open file descriptors

In Apache 1.3.3 (Solaris) we are using the USR1 signal (or HUP) to rotate the
log files daily.

Our rotation strategy is:
1) rename log file
2) issue USR1

What appears to be happening though, is that Apache is not closing the file
descriptors for the old log files. (We eventually run out of file descriptors -
in just over a month)  and lsof shows that Apache still has all the old log
files open.

Anyone else noticed this behaviour?

Thanks,
Mark Hume

2. 2.5.59-dcl2

3. Apache vhost transactions not to log

4. Oracle

5. Really useful/pretty apache vhost logging?

6. looking for `A*' from AT&T -- an improved awk?

7. Apache: logging vhosts

8. Beep

9. Seperate log files for mass dynamic vhosts ?

10. name base vhosting and log files

11. Newbie: Apache, Vhosts, Hosts file and BIND

12. Apache Logs : wrong entries in log files

13. Apache logging virtual hosts in one log file