[logback-dev] [JIRA] Commented: (LBCORE-58) AppenderBase doAppend is synchronized causing significant performance problems when calling appenders.

Ralph Goers (JIRA) noreply-jira at qos.ch
Tue Oct 14 22:05:21 CEST 2008


    [ http://jira.qos.ch/browse/LBCORE-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10769#action_10769 ] 

Ralph Goers commented on LBCORE-58:
-----------------------------------

The Appender documentation currently calls out that doAppender is synchronized. This should be changed to specifically state that Appenders should be thread safe, adding locking where required.

As for the socketAppender. the major problem with it is that it opens the OutputStream in start and then shares it on every call to Append. If there was a pool of sockets and the OutputStream was created in the append method then the append method could easily be made thread safe - and probably perform better.

> AppenderBase doAppend is synchronized causing significant performance problems when calling appenders.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: LBCORE-58
>                 URL: http://jira.qos.ch/browse/LBCORE-58
>             Project: logback-core
>          Issue Type: Bug
>          Components: Appender
>    Affects Versions: 0.9.10
>         Environment: All
>            Reporter: Ralph Goers
>            Assignee: Ceki Gulcu
>         Attachments: appenderlock.txt
>
>
> Slow appenders cause Logback to be a significant bottleneck in the system.  AppenderBase doAppend is synchronized to allow Appenders to be threadsafe. This is an extremely poor way to accomplish that. Many Appenders are slow since they are dealing with I/O of some kind but may be thread safe. Where they are not they should deal with the issue at the smallest granularity possible. AppenderBase must be changed to not be synchronized and any Appenders that are not thread safe should be modified appropriately.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list