httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <>
Subject Re: yet another [PATCH] to mod_log_config.c -- tunable LOG_BUFSIZE
Date Fri, 12 Feb 1999 18:42:34 GMT
>Sorry for being naive, but what do I need to worry about going wrong,
>exactly? I'm writing a program for accepting logs from a pipe so that
>I can decouple Apache from the log file so that it can be rotated
>without bothering Apache and so that the disk overhead is reduced.
>There is potential for logs in a buffer somewhere to be lost if
>something goes tits-up but I can't see a way of completely avoiding
>that so long as I'm not logging straight to a file.

The effect of writing more than PIPE_BUF is that the kernel doesn't
guarantee that it won't switch to another process during mid-write,
which may lead to the second process also starting a log write at the
position in the buffer that the other one stopped in mid-write.  The
result is like having two overlapping pieces of paper -- some entries
get completely obscured and two entries get merged into one invalid entry.

How often this occurs depends on the load of the server.  What you could
do is test it with various buffer sizes and a high server load, and then
run wwwstat on them with the -e option (prints corrupted entries to stderr).
It may be that your kernel is capable of writing much more than the
advertised PIPE_BUF in one atomic action.


View raw message