You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tony Finch <do...@dotat.at> on 1999/02/11 13:23:20 UTC

yet another [PATCH] to mod_log_config.c -- tunable LOG_BUFSIZE

This is fairly trivial, but it allows me to increase the log buffer
size if I don't particularly care about the atomicity of writes. On
FreeBSD PIPE_BUF is only 512 bytes but I can get better performance
if I write data in bigger chunks.

Tony.
-- 
f.a.n.finch  dot@dotat.at  fanf@demon.net

Index: src/modules/standard/mod_log_config.c
===================================================================
RCS file: /a/cvsroot/src/www/apache_1-3_fanf/src/modules/standard/mod_log_config.c,v
retrieving revision 1.7
diff -u -r1.7 mod_log_config.c
--- mod_log_config.c	1999/02/11 12:11:56	1.7
+++ mod_log_config.c	1999/02/11 12:12:30
@@ -194,10 +194,12 @@
  * because it's probably a good guess as to what is implemented correctly
  * everywhere.
  */
+#ifndef LOG_BUFSIZE
 #ifdef PIPE_BUF
 #define LOG_BUFSIZE     PIPE_BUF
 #else
 #define LOG_BUFSIZE     (512)
+#endif
 #endif
 
 /*

Re: yet another [PATCH] to mod_log_config.c -- tunable LOG_BUFSIZE

Posted by Tony Finch <do...@dotat.at>.
"Roy T. Fielding" <fi...@kiwi.ics.uci.edu> wrote:
>>This is fairly trivial, but it allows me to increase the log buffer
>>size if I don't particularly care about the atomicity of writes. On
>>FreeBSD PIPE_BUF is only 512 bytes but I can get better performance
>>if I write data in bigger chunks.
>
>What is the point of logging at all if you allow the log to get trodden?
>I remember getting log overwrites back in '94, while only serving
>30,000 requests per month -- they are not a rare occurrence.

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.

Tony.
-- 
f.a.n.finch  dot@dotat.at  fanf@demon.net