You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Bill Moseley <mo...@hank.org> on 2014/09/06 16:31:56 UTC

[users@httpd] Prefork MPM: Locking of error logs during write?

Apache 2.2.15 on Linux.

When Apache children send output to stderr it ends up in my error_log file.

Does Apache have any mechanism to prevent intermixing of this output?
That is, if all Apache children write large ( but < 4k) strings to stderr
does Apache have anything to prevent inter mixing of the output?

Apache doesn't do any locking or use semaphores to prevent concurrent
writing to the log, correct?


-- 
Bill Moseley
moseley@hank.org

Re: [users@httpd] Prefork MPM: Locking of error logs during write?

Posted by Bill Moseley <mo...@hank.org>.
On Sun, Sep 7, 2014 at 4:30 PM, Jeff Trawick <tr...@gmail.com> wrote:

>
> Apache httpd on Unix doesn't use locking.  The file is opened in the
> parent with O_APPEND.
>
> If the writers inherit that descriptor, all is okay for "small" buffers;
> if a writer opens without O_APPEND, bad.
>

Thanks Jeff,

In my tests over the last few days it's clear that buffer is about 4K (On
CentOS, anyway).   I wrote tens of gigs of logs using 50 processes and
never say any intermixing of the logs at all with the message < 4K.   With
a larger log message it was easy to trigger the mixing of logs.

Thanks for the information and confirmation.



-- 
Bill Moseley
moseley@hank.org

Re: [users@httpd] Prefork MPM: Locking of error logs during write?

Posted by Jeff Trawick <tr...@gmail.com>.
On Sat, Sep 6, 2014 at 10:31 AM, Bill Moseley <mo...@hank.org> wrote:

> Apache 2.2.15 on Linux.
>
> When Apache children send output to stderr it ends up in my error_log file.
>
> Does Apache have any mechanism to prevent intermixing of this output?
> That is, if all Apache children write large ( but < 4k) strings to stderr
> does Apache have anything to prevent inter mixing of the output?
>
> Apache doesn't do any locking or use semaphores to prevent concurrent
> writing to the log, correct?
>
>
> --
> Bill Moseley
> moseley@hank.org
>

Apache httpd on Unix doesn't use locking.  The file is opened in the parent
with O_APPEND.

If the writers inherit that descriptor, all is okay for "small" buffers; if
a writer opens without O_APPEND, bad.

-- 
Born in Roswell... married an alien...
http://emptyhammock.com/