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

Graeme Moss edited comment on AMQ-7102 at 7/31/19 11:41 AM:
------------------------------------------------------------

This is a good fix.  Thanks.  Unfortunately we are using 5.15.6 and the 
possibility of an upgrade seems difficult for various reasons.

However, why is this collection a CopyOnWriteArraySet?  It seems that most of 
the time you will be wanting to modify this set, and modifications seem 
particularly slow for a CopyOnWriteArraySet.  It locks the set entirely whilst 
it (potentially) searches all elements linearly for the element you are 
adding/removing and then copies them all.  Would it not be better to have a 
ConcurrentHashSet, like the ConcurrentHashMap fields that key on ObjectName in 
ManagedRegionBroker?

We have a broker running with 600k elements in registeredMBeans and we severe 
performance issues when adding/removing many subscribers at once (e.g. 
something that adds subscribers usually takes 2 mins but when many other 
subscribers are added and removed at the same time it takes 45 mins, over 20 
times slower).  Looking at stackdumps of the broker I see many (40+) threads 
BLOCKED on trying to get a lock on the underlying CopyOnWriteArrayList whilst 
trying to add/remove subscribers.


was (Author: graeme_moss):
This is a good fix.  Thanks.  Unfortunately we are using 5.15.6 and the 
possibility of an upgrade seems difficult for various reasons.

However, why is this collection a CopyOnWriteArraySet?  It seems that most of 
the time you will be wanting to modify this set, and modifications seem 
particularly slow for a CopyOnWriteArraySet.  It locks the set entirely whilst 
it searches all elements linearly for the element you are adding/removing.  
Would it not be better to have a ConcurrentHashSet, like the ConcurrentHashMap 
fields that key on ObjectName in ManagedRegionBroker?

We have a broker running with 600k elements in registeredMBeans and we severe 
performance issues when adding/removing many subscribers at once (e.g. 
something that adds subscribers usually takes 2 mins but when many other 
subscribers are added and removed at the same time it takes 45 mins, over 20 
times slower).  Looking at stackdumps of the broker I see many (40+) threads 
BLOCKED on trying to get a lock on the underlying CopyOnWriteArrayList whilst 
trying to add/remove subscribers.

> managementContext suppressMBean filters registration but still tracks objects 
> as registered in error
> ----------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-7102
>                 URL: https://issues.apache.org/jira/browse/AMQ-7102
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: JMX
>    Affects Versions: 5.15.0
>            Reporter: Gary Tully
>            Assignee: Gary Tully
>            Priority: Major
>             Fix For: 5.16.0
>
>
> The suppressMbean feature could be better is we don't unnecessarily track the 
> suppressed mbean registrations in out copy on write set.
> Under load, the additional work on add/remove this can be a significant 
> burden.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to