You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Néstor Boscán <ne...@tcsapp.com.ve> on 2006/05/17 16:24:05 UTC

Log4J blocking on heavy load

Hi
 
I'm working with Log4J on a heavy load application and we're using it for
performance, debug and error information. All our loggers are using
RollingFileAppender and we generate a lot of logging information. Our
application is running very slow and after a profiling test we discovered
that Log4J was blocking the threads. I've read about this problem in some
web sites but none give a clear solution to the problem. Anyone has
succesfully resolved this problem?. What options do I have?
 
Regards,
 
Néstor Boscán

Re: Log4J blocking on heavy load

Posted by Curt Arnold <ca...@apache.org>.
On May 19, 2006, at 11:09 AM, Néstor Boscán wrote:

> Hi Curt
>
> I tried to patch the file but didn't work. Can you send the .java  
> file?
>
> Regards,
>
> Néstor Boscán


I've committed the new AsyncAppender.java to the log4j 1.2 branch in  
the SVN.  If we ever release another 1.2.x branch, then we will need  
to make a decision if it has had enough testing to make it into the  
release.

You can download just the one file using http://svn.apache.org/repos/ 
asf/logging/log4j/branches/v1_2-branch/src/java/org/apache/log4j/ 
AsyncAppender.java.  Or you can check out the whole log4j 1.2 branch  
using:

svn co http://svn.apache.org/repos/asf/logging/log4j/branches/v1_2- 
branch log4j12

If you want to use this implementation of AsyncAppender with already  
deployed versions of log4j, please change the package name  
accordingly (and it should not be an org.apache package name).
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: Log4J blocking on heavy load

Posted by Néstor Boscán <ne...@tcsapp.com.ve>.
Hi Curt

I tried to patch the file but didn't work. Can you send the .java file?

Regards,

Néstor Boscán 

-----Mensaje original-----
De: Curt Arnold [mailto:carnold@apache.org] 
Enviado el: Wednesday, May 17, 2006 1:16 PM
Para: Log4J Users List
Asunto: Re: Log4J blocking on heavy load


On May 17, 2006, at 10:48 AM, Néstor Boscán wrote:

> Hi Curt
>
> Thanks for the quick reply.
>
> Do you know if this will be part of a future release of Log4J 1.2.*?.
>
> Regards,
>
> Néstor Boscán
>


Currently, there are no plans for a future release of log4j 1.2.*.   
If there is another release of log4j 1.2, then I would hope that the new
AsyncAppender goes in as the bugs reports suggest that the current
implementation is pretty seriously broken.  However, since the log4j 1.2
AsyncAppender has been out in the field for a long time and the 1.3
implementation is a substantial rewriting, it would be pretty risky to push
the new implementation out to people who are satisfied with the old
implementation.

A possibility would be to throw up a log4j 1.2 compatible AsyncAppender in
the sandbox under a slightly different class name
(org.apache.log4j.sandbox.AsyncAppender?) to make it easy to use the new
AsyncAppender with log4j 1.2.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: Log4J blocking on heavy load

Posted by Néstor Boscán <ne...@tcsapp.com.ve>.
Hi Curt

I downloaded a patch utility but I'm getting:

Appender.patch
patching file AsyncAppender.java
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 339

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.

Do you have the AsyncAppender file already patched so I can simply replace
the file and build.

Regards,

Néstor Boscán  

-----Mensaje original-----
De: Curt Arnold [mailto:carnold@apache.org] 
Enviado el: Wednesday, May 17, 2006 1:16 PM
Para: Log4J Users List
Asunto: Re: Log4J blocking on heavy load


On May 17, 2006, at 10:48 AM, Néstor Boscán wrote:

> Hi Curt
>
> Thanks for the quick reply.
>
> Do you know if this will be part of a future release of Log4J 1.2.*?.
>
> Regards,
>
> Néstor Boscán
>


Currently, there are no plans for a future release of log4j 1.2.*.   
If there is another release of log4j 1.2, then I would hope that the new
AsyncAppender goes in as the bugs reports suggest that the current
implementation is pretty seriously broken.  However, since the log4j 1.2
AsyncAppender has been out in the field for a long time and the 1.3
implementation is a substantial rewriting, it would be pretty risky to push
the new implementation out to people who are satisfied with the old
implementation.

A possibility would be to throw up a log4j 1.2 compatible AsyncAppender in
the sandbox under a slightly different class name
(org.apache.log4j.sandbox.AsyncAppender?) to make it easy to use the new
AsyncAppender with log4j 1.2.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: Log4J blocking on heavy load

Posted by Néstor Boscán <ne...@tcsapp.com.ve>.
Hi Curt 

Thanks for the reply.

I've downloaded the patch but I don't know where to download the "patch"
utility.

Regards,

Néstor Boscán  

-----Mensaje original-----
De: Curt Arnold [mailto:carnold@apache.org] 
Enviado el: Wednesday, May 17, 2006 1:16 PM
Para: Log4J Users List
Asunto: Re: Log4J blocking on heavy load


On May 17, 2006, at 10:48 AM, Néstor Boscán wrote:

> Hi Curt
>
> Thanks for the quick reply.
>
> Do you know if this will be part of a future release of Log4J 1.2.*?.
>
> Regards,
>
> Néstor Boscán
>


Currently, there are no plans for a future release of log4j 1.2.*.   
If there is another release of log4j 1.2, then I would hope that the new
AsyncAppender goes in as the bugs reports suggest that the current
implementation is pretty seriously broken.  However, since the log4j 1.2
AsyncAppender has been out in the field for a long time and the 1.3
implementation is a substantial rewriting, it would be pretty risky to push
the new implementation out to people who are satisfied with the old
implementation.

A possibility would be to throw up a log4j 1.2 compatible AsyncAppender in
the sandbox under a slightly different class name
(org.apache.log4j.sandbox.AsyncAppender?) to make it easy to use the new
AsyncAppender with log4j 1.2.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4J blocking on heavy load

Posted by Curt Arnold <ca...@apache.org>.
On May 17, 2006, at 10:48 AM, Néstor Boscán wrote:

> Hi Curt
>
> Thanks for the quick reply.
>
> Do you know if this will be part of a future release of Log4J 1.2.*?.
>
> Regards,
>
> Néstor Boscán
>


Currently, there are no plans for a future release of log4j 1.2.*.   
If there is another release of log4j 1.2, then I would hope that the  
new AsyncAppender goes in as the bugs reports suggest that the  
current implementation is pretty seriously broken.  However, since  
the log4j 1.2 AsyncAppender has been out in the field for a long time  
and the 1.3 implementation is a substantial rewriting, it would be  
pretty risky to push the new implementation out to people who are  
satisfied with the old implementation.

A possibility would be to throw up a log4j 1.2 compatible  
AsyncAppender in the sandbox under a slightly different class name  
(org.apache.log4j.sandbox.AsyncAppender?) to make it easy to use the  
new AsyncAppender with log4j 1.2.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: Log4J blocking on heavy load

Posted by Néstor Boscán <ne...@tcsapp.com.ve>.
Hi Curt

Thanks for the quick reply.

Do you know if this will be part of a future release of Log4J 1.2.*?. 

Regards,

Néstor Boscán 

-----Mensaje original-----
De: Curt Arnold [mailto:carnold@apache.org] 
Enviado el: Wednesday, May 17, 2006 11:21 AM
Para: Log4J Users List
Asunto: Re: Log4J blocking on heavy load

Wrapping your RollingFileAppender with an AsyncAppender might address your
problems.  There were a lot of issues with the AsyncAppender that were
recently (March 2006) addressed in the SVN trunk.  If you are using log4j
1.2, you may want to back port the log4j 1.3 AsyncAppender (see note on
http://issues.apache.org/bugzilla/
show_bug.cgi?id=38982 for instructions) if you run into problems.

Basically using an AsyncAppender will place logging events in a fixed size
queue.  Other logging requests will only need to be blocked for the time
needed to update the queue, not the time needed to do the file IO.  When the
queue hits the maximum size, the default behavior in the log4j 1.3 appender
(and the only behavior in the log4j 1.2) is to block other logging requests
until some of the logging requests are removed from the queue.  The log4j
1.3 appender added a new property "blocking" which when set to false does
not wait for the queue to have vacancies and will summarize the events that
were dropped.


On May 17, 2006, at 9:24 AM, Néstor Boscán wrote:

> Hi
>
> I'm working with Log4J on a heavy load application and we're using it 
> for performance, debug and error information. All our loggers are 
> using RollingFileAppender and we generate a lot of logging 
> information. Our application is running very slow and after a 
> profiling test we discovered that Log4J was blocking the threads. I've 
> read about this problem in some web sites but none give a clear 
> solution to the problem. Anyone has succesfully resolved this 
> problem?. What options do I have?
>
> Regards,
>
> Néstor Boscán


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4J blocking on heavy load

Posted by Curt Arnold <ca...@apache.org>.
Wrapping your RollingFileAppender with an AsyncAppender might address  
your problems.  There were a lot of issues with the AsyncAppender  
that were recently (March 2006) addressed in the SVN trunk.  If you  
are using log4j 1.2, you may want to back port the log4j 1.3  
AsyncAppender (see note on http://issues.apache.org/bugzilla/ 
show_bug.cgi?id=38982 for instructions) if you run into problems.

Basically using an AsyncAppender will place logging events in a fixed  
size queue.  Other logging requests will only need to be blocked for  
the time needed to update the queue, not the time needed to do the  
file IO.  When the queue hits the maximum size, the default behavior  
in the log4j 1.3 appender (and the only behavior in the log4j 1.2) is  
to block other logging requests until some of the logging requests  
are removed from the queue.  The log4j 1.3 appender added a new  
property "blocking" which when set to false does not wait for the  
queue to have vacancies and will summarize the events that were dropped.


On May 17, 2006, at 9:24 AM, Néstor Boscán wrote:

> Hi
>
> I'm working with Log4J on a heavy load application and we're using  
> it for
> performance, debug and error information. All our loggers are using
> RollingFileAppender and we generate a lot of logging information. Our
> application is running very slow and after a profiling test we  
> discovered
> that Log4J was blocking the threads. I've read about this problem  
> in some
> web sites but none give a clear solution to the problem. Anyone has
> succesfully resolved this problem?. What options do I have?
>
> Regards,
>
> Néstor Boscán


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org