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

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: Logback dev list 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

[ http://jira.qos.ch/browse/LBCORE-58?page=com.atlassian.jira.plugin.system.is... ] Ralph Goers updated LBCORE-58: ------------------------------ Attachment: appenderlock.txt The attached patch moves synchronization to the appenders. This patch is rather simple. It doesn't try to fix the synchronization problems in the layouts and appenders. These will be attacked individually through separate patches.
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: Logback dev list 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

[ http://jira.qos.ch/browse/LBCORE-58?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu commented on LBCORE-58: ---------------------------------- Current code in AppenderBase "forces" the doAppend method to be synchronized, "liberating" derived appenders from worrying about synchronization. Hypothetically speaking, an appender could ignore AppenderBase and just implement the Appender interface on its own. Although I like your patch, I am also a little worried that developers (including myself) will forget to perform proper synchronization in new appenders. Nevertheless, I also agree that synchronization in doAppend method imposes too many restrictions on derived appenders. As a test case, I suggest SocketAppender which does not have a layout (one less component to worry about) and is very closely related to bug LBCLASSIC-35. Can you think of an approach which would solve LBCLASSIC-35 in presence of a very very very slow socket server?
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

[ http://jira.qos.ch/browse/LBCORE-58?page=com.atlassian.jira.plugin.system.is... ] 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

[ http://jira.qos.ch/browse/LBCORE-58?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu updated LBCORE-58: ----------------------------- Parent: LBCORE-62 Issue Type: Sub-task (was: Bug)
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: Sub-task 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

[ http://jira.qos.ch/browse/LBCORE-58?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu resolved LBCORE-58. ------------------------------ Fix Version/s: 0.9.14 Resolution: Fixed For expediency, I am marking it fixed in 0.9.14. However, in reality, this bug was fixed in an earlier logback version.
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: Sub-task Components: Appender Affects Versions: 0.9.10 Environment: All Reporter: Ralph Goers Assignee: Ceki Gulcu Fix For: 0.9.14
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

[ http://jira.qos.ch/browse/LBCLASSIC-136?page=com.atlassian.jira.plugin.syste... ] Ceki Gulcu moved LBCORE-58 to LBCLASSIC-136: -------------------------------------------- Project: logback-classic (was: logback-core) Key: LBCLASSIC-136 (was: LBCORE-58)
AppenderBase doAppend is synchronized causing significant performance problems when calling appenders. ------------------------------------------------------------------------------------------------------
Key: LBCLASSIC-136 URL: http://jira.qos.ch/browse/LBCLASSIC-136 Project: logback-classic Issue Type: Sub-task Components: Appender Affects Versions: 0.9.10 Environment: All Reporter: Ralph Goers Assignee: Ceki Gulcu Fix For: 0.9.14
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
participants (2)
-
Ceki Gulcu (JIRA)
-
Ralph Goers (JIRA)