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

Dominik Psenner commented on LOG4NET-454:
-----------------------------------------

The configuration you have posted does not limit the file size, it rolls by 
date and not by file size. Therefore I do not understand how that would limit 
the file size and hence all the argumentation should not have any effect.

That apart, can you investigate on this issue with a performance profiler? More 
information on the environment would also be interesting and help pinpointing 
this issue to a common denominator:

- operating system
- .net framework version
- cpu information
- hard drive information
- is the application run from a network share?
- ...

> Intermittent severe slowdown with RollingFileAppender+MinimalLock
> -----------------------------------------------------------------
>
>                 Key: LOG4NET-454
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-454
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13
>         Environment: ASP.NET MVC 5.2.2 Application, Windows 7 Professional
>            Reporter: Chuck Felish
>
> Using RollingFileAppender with MinimalLock we found an extreme slowdown in 
> the processing of our application requests (from 300ms to up to 15s in some 
> cases) which was resolved when we deleted our log files. We also found that 
> changing the lock to Exclusive resolved the issue.
> Interestingly file content seemed to be related, but not file size. When I 
> took the contents of a colleague's log file and pasted them into my own log 
> file the slowness issue appeared again. I then tried deleting about half the 
> contents and then causing the file to grow to larger than the original size 
> but the issue did not return. Pasting the original contents back into the 
> file caused the performance issue to return.
> While Exclusive lock has resolved our issue for now, it's quite unexpected 
> that file contents would affect performance at all, and that the issue is 
> does not consistently reproduce even though configuration is unchanged.
> I'm happy to demonstrate and/or share our problematic log files with you to 
> facilitate the resolution of this issue.
> Our configuration is as follows:
>     <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
>         <file type="log4net.Util.PatternString" 
> value="Logs\%property{ExecutableName}_%env{COMPUTERNAME}.log" />
>         <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
>         <appendToFile value="true" />
>         <rollingStyle value="Size" />
>         <maximumFileSize value="5MB" />
>         <maxSizeRollBackups value="50" />
>         <preserveLogFileNameExtension value="true" />
>         <layout type="log4net.Layout.PatternLayout">
>             <conversionPattern value="%d{yyyy-MM-dd HH:mm:ss.fff} 
> [%-5level][%5thread] %logger - %m%n" />
>         </layout>
>     </appender>
>     <root>
>         <!-- NOTE:  This is overriden programatically by Log4NetConfig.cs -->
>         <level value="ALL" />
> <!--        <appender-ref ref="ColorConsole" />-->
>         <appender-ref ref="RollingFile" />
>     </root>



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

Reply via email to