[ https://issues.apache.org/jira/browse/OAK-7259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16378532#comment-16378532 ]
Michael Dürig commented on OAK-7259: ------------------------------------ I share [~frm] concerns re. {{updateCommitsCountMap()}} not being thread safe and I think this is not comparable with {{ConcurrentHashMap}}. Concurrent calls to {{updateCommitsCountMap()}} might lead to an incoherent state that is non transient. However, I also share [~dulceanu] concerns re. adding additional potential contention points on the "commit path". As an alternative, couldn't we move the chore of updating {{commitsCountMap}} to the consumer thread calling {{SegmentNodeStoreStats.getCommitsCountPerWriter()}}? My idea would be to queue pending {{writernNames}} s that would otherwise be directly passed to {{updateCommitsCountMap()}} and batch process them in calls to {{getCommitsCountPerWriter()}}. IMO a good starting point would be to move all related logic to its own class as [~frm] suggested as well. >From the peanut gallery: * {{Thread.getStackTrace()}} is expensive. We need to understand whether this is problematic in this context or not. Starting with Java 9 there is {{StackWalker}}, which is supposed to be cheaper. Until then, we should probably have a way to switch collecting stack traces off. * Can we unify {{SegmentNodeStoreStats.dequeuedAfter()}} and {{SegmentNodeStoreStats.onCommitDequeued()}}? * I would prefer to return an empty table from {{SegmentNodeStoreStatsMBean.getCommitsCountPerWriter()}} and {{SegmentNodeStoreStatsMBean.getQueuedWriters()}} instead of throwing an {{OpenDataException}}. * Just an idea for now, can (should?) we make {{SegmentNodeStoreStats.commitsCountMapMaxSize}} configurable through a setter in {{SegmentNodeStoreStatsMBean}}? > Improve SegmentNodeStoreStats to include number of commits per thread and > threads currently waiting on the semaphore > -------------------------------------------------------------------------------------------------------------------- > > Key: OAK-7259 > URL: https://issues.apache.org/jira/browse/OAK-7259 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: segment-tar > Reporter: Andrei Dulceanu > Assignee: Andrei Dulceanu > Priority: Major > Labels: tooling > Fix For: 1.9.0, 1.10 > > > When investigating the performance of {{segment-tar}}, the source of the > writes (commits) is a very useful indicator of the cause. > To better understand which threads are currently writing in the repository > and which are blocked on the semaphore, we need to improve > {{SegmentNodeStoreStats}} to: > * expose the number of commits executed per thread > * expose threads currently waiting on the semaphore -- This message was sent by Atlassian JIRA (v7.6.3#76005)