logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LOG4J2-940) Large number of RUNNABLE threads at "AsyncLoggerConfig.callAppenders" causing High CPU
Date Wed, 21 Jan 2015 14:39:35 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14285060#comment-14285060
] 

Remko Popma edited comment on LOG4J2-940 at 1/21/15 2:38 PM:
-------------------------------------------------------------

Thanks for the details!

We will look for opportunity to reduce the number of logs. Also when we try to make few of
the logs Async and few of them Sync is giving a wired issue, All logs are getting written
with same content. All log file sizes are same. Here is the log4j configuration

{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="debug">
			<Appenders>

							<File name="ABCLogAppender" fileName="/logs/ABCLogFile.log">
											<PatternLayout pattern="%d{yyyy.MM.dd HH:mm:ss,SSS}|%X{URID}:%X{SKEY}|%X{CRID}|
%p [ %C %M ]   %m%n " />
							</File>

							<File name="BCDLogAppender" fileName="/logs/BCDTranLogFile.log">
											<PatternLayout pattern="%d{yyyy.MM.dd HH:mm:ss,SSS}|%X{URID}:%X{SKEY}|%X{CRID}|
%p [ %C %M ]   %m%n " />
							</File>  

							<!-- Remaining entired -->
			
			</Appenders>

			<Loggers>

							<AsyncLogger name="ABCLogFile" level="DEBUG" additivity="false">
											<AppenderRef ref="ABCLogAppender" />
							</AsyncLogger>

							<AsyncLogger name="BCDLogFile" level="DEBUG" additivity="false">
											<AppenderRef ref="BCDLogAppender" />
							</AsyncLogger>

							<!-- Rest of AsncLogger -->
							
							<!-- Sync logging -->                          
								 
							 <Root level="info">
								  <AppenderRef ref="ABCLogAppender"/>
							</Root>
											
							 <Root level="info">
								 <AppenderRef ref="CDELogAppender" />
							</Root>
							
							<!-- Rest of SyncLogger -->
											
			</Loggers>

</Configuration>
{code}



was (Author: kbsivacse):
Thanks for the details!

We will look for opportunity to reduce the number of logs. Also when we try to make few of
the logs Async and few of them Sync is giving a wired issue, All logs are getting written
with same content. All log file sizes are same. Here is the log4j configuration


<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="debug">
			<Appenders>

							<File name="ABCLogAppender" fileName="/logs/ABCLogFile.log">
											<PatternLayout pattern="%d{yyyy.MM.dd HH:mm:ss,SSS}|%X{URID}:%X{SKEY}|%X{CRID}|
%p [ %C %M ]   %m%n " />
							</File>

							<File name="BCDLogAppender" fileName="/logs/BCDTranLogFile.log">
											<PatternLayout pattern="%d{yyyy.MM.dd HH:mm:ss,SSS}|%X{URID}:%X{SKEY}|%X{CRID}|
%p [ %C %M ]   %m%n " />
							</File>  

							<!-- Remaining entired -->
			
			</Appenders>

			<Loggers>

							<AsyncLogger name="ABCLogFile" level="DEBUG" additivity="false">
											<AppenderRef ref="ABCLogAppender" />
							</AsyncLogger>

							<AsyncLogger name="BCDLogFile" level="DEBUG" additivity="false">
											<AppenderRef ref="BCDLogAppender" />
							</AsyncLogger>

							<!-- Rest of AsncLogger -->
							
							<!-- Sync logging -->                          
								 
							 <Root level="info">
								  <AppenderRef ref="ABCLogAppender"/>
							</Root>
											
							 <Root level="info">
								 <AppenderRef ref="CDELogAppender" />
							</Root>
							
							<!-- Rest of SyncLogger -->
											
			</Loggers>

</Configuration>


> Large number of RUNNABLE threads at "AsyncLoggerConfig.callAppenders" causing High CPU
> --------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-940
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-940
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-rc2
>         Environment: RHEL 6.2
> Apache Tomcat 7
> Java 7
>            Reporter: Siva B
>
> 336 threads are in RUNNING state with below stack trace causing the JVM to consume more
CPU.
> "ajp-bio-15024-exec-138" daemon prio=10 tid=0x00007f5870046000 nid=0x52d7 runnable [0x00007f5921f56000]
>    java.lang.Thread.State: TIMED_WAITING (parking)
> 	at sun.misc.Unsafe.park(Native Method)
> 	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:349)
> 	at com.lmax.disruptor.MultiProducerSequencer.next(MultiProducerSequencer.java:133)
> 	at com.lmax.disruptor.MultiProducerSequencer.next(MultiProducerSequencer.java:102)
> 	at com.lmax.disruptor.RingBuffer.publishEvent(RingBuffer.java:466)
> 	at org.apache.logging.log4j.core.async.AsyncLoggerConfigHelper.callAppendersFromAnotherThread(AsyncLoggerConfigHelper.java:342)
> 	at org.apache.logging.log4j.core.async.AsyncLoggerConfig.callAppenders(AsyncLoggerConfig.java:111)
> 	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:407)
> 	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:365)
> 	at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:103)
> 	at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1336)
> 	at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1325)
> 	at org.apache.logging.log4j.spi.AbstractLogger.log(AbstractLogger.java:1237)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message