You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Thushara Wijeratna <th...@gmail.com> on 2006/10/09 20:43:39 UTC
[users@httpd] interaction btn apache and cronolog
Can you recommend where I can read about the interaction btn apache
and cronolog? I have a problem in an apache server setup where the
output (created through cronolog) is corrupt. It sure looks like 2
processes were writing to the same file and one process overwrote the
other one.
So I have lines in the output logs like this:
CSID=L0CSID=C05504
Here, it looks like a line starting CSID=L08956 got overwritten right
after the "0" character and the other process started writing
"CSID=C05504" to where the file ptr was.
Not knowing the interaction btn cronolog and apache, it is hard for me
to debug this.
I'm on apache 2.0.54, cronolog 1.6.2
Thanks
Thushara
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] interaction btn apache and cronolog
Posted by Thushara Wijeratna <th...@gmail.com>.
Seems like the parent apache process creates the pipe to cronolog. The
children must be sending their output to the parent that will in turn
pipe it to cronolog.
The only other thing is that we're using an environment variable
expansion (macro) in the CustomLog string, as described here :
http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/q20201/mod/mod_log_config.html#formats
Any clues as to how I can further debug this is much appreciated.
Thushara
On 10/20/06, Thushara Wijeratna <th...@gmail.com> wrote:
> Hi Georgi,
>
> Thanks for that info. Digging into this a bit more, I find we're using
> a modified cronolog - sorry I didn't see this before. The one big
> difference seems to be that we're using getc, vs read call to read the
> input in our cronolog.c. I'm suspecting that buffer size mismatch has
> something to do with this (getc would buffer with 8192 and the
> original cronolog seems to buffer 65536 bytes)
>
> Apache writes from multiple child processes cannot be interleaved
> right? Even if we used getc instead of read, shouldn't we still get
> the bytes in the order apache processes wrote them?
>
> Thanks,
> Thushara
>
>
> On 10/11/06, Georgi Chorbadzhiyski <gf...@unixsol.org> wrote:
> > Thushara Wijeratna wrote:
> > > Thanks Georgi, in my case there is only one virtual host, but of
> > > course there are around 500 httpd child processes running and writing
> > > into one cronolog.
> > >
> > > That is the part that I couldn't quite grasp. When I do a ps auxww, I
> > > see a cronolog process (just 1) all the time, so it sure looks like
> > > all the httpd children are writing to this one cronolog process.
> > >
> > > Tp avoid corruption, should we have one cronolog process for each
> > > httpd child, instead?
> >
> > Oh no, that would be overkill and I don't think it is even possible to
> > make such configuration. May be there is some bug in cronolog. I've
> > used cronolog on some pretty heave loaded sites and never saw such a
> > problem like yours.
> >
> > Can you try rotatelogs program from apache distribution and see if the
> > problem persists.
> >
> > --
> > Georgi Chorbadzhiyski
> > http://georgi.unixsol.org/
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > " from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
> >
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] interaction btn apache and cronolog
Posted by Georgi Chorbadzhiyski <gf...@unixsol.org>.
Thushara Wijeratna wrote:
> Thanks Georgi, in my case there is only one virtual host, but of
> course there are around 500 httpd child processes running and writing
> into one cronolog.
>
> That is the part that I couldn't quite grasp. When I do a ps auxww, I
> see a cronolog process (just 1) all the time, so it sure looks like
> all the httpd children are writing to this one cronolog process.
>
> Tp avoid corruption, should we have one cronolog process for each
> httpd child, instead?
Oh no, that would be overkill and I don't think it is even possible to
make such configuration. May be there is some bug in cronolog. I've
used cronolog on some pretty heave loaded sites and never saw such a
problem like yours.
Can you try rotatelogs program from apache distribution and see if the
problem persists.
--
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] interaction btn apache and cronolog
Posted by Thushara Wijeratna <th...@gmail.com>.
Thanks Georgi, in my case there is only one virtual host, but of
course there are around 500 httpd child processes running and writing
into one cronolog.
That is the part that I couldn't quite grasp. When I do a ps auxww, I
see a cronolog process (just 1) all the time, so it sure looks like
all the httpd children are writing to this one cronolog process.
Tp avoid corruption, should we have one cronolog process for each
httpd child, instead?
Thushara
On 10/11/06, Georgi Chorbadzhiyski <gf...@unixsol.org> wrote:
> Thushara Wijeratna wrote:
> > Can you recommend where I can read about the interaction btn apache
> > and cronolog? I have a problem in an apache server setup where the
> > output (created through cronolog) is corrupt. It sure looks like 2
> > processes were writing to the same file and one process overwrote the
> > other one.
> >
> > So I have lines in the output logs like this:
> >
> > CSID=L0CSID=C05504
> >
> > Here, it looks like a line starting CSID=L08956 got overwritten right
> > after the "0" character and the other process started writing
> > "CSID=C05504" to where the file ptr was.
> >
> > Not knowing the interaction btn cronolog and apache, it is hard for me
> > to debug this.
> >
> > I'm on apache 2.0.54, cronolog 1.6.2
>
> This may happen if two virtual hosts are piping logs trough cronolog
> and cronolog logs into the same file.
>
> Basically apache just opens the log program and writes requests to it
> no synchronization takes place. Make sure every cronolog instance writes
> to it's own file.
>
> --
> Georgi Chorbadzhiyski
> http://georgi.unixsol.org/
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] interaction btn apache and cronolog
Posted by Georgi Chorbadzhiyski <gf...@unixsol.org>.
Thushara Wijeratna wrote:
> Can you recommend where I can read about the interaction btn apache
> and cronolog? I have a problem in an apache server setup where the
> output (created through cronolog) is corrupt. It sure looks like 2
> processes were writing to the same file and one process overwrote the
> other one.
>
> So I have lines in the output logs like this:
>
> CSID=L0CSID=C05504
>
> Here, it looks like a line starting CSID=L08956 got overwritten right
> after the "0" character and the other process started writing
> "CSID=C05504" to where the file ptr was.
>
> Not knowing the interaction btn cronolog and apache, it is hard for me
> to debug this.
>
> I'm on apache 2.0.54, cronolog 1.6.2
This may happen if two virtual hosts are piping logs trough cronolog
and cronolog logs into the same file.
Basically apache just opens the log program and writes requests to it
no synchronization takes place. Make sure every cronolog instance writes
to it's own file.
--
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org