[ https://issues.apache.org/jira/browse/ARTEMIS-4575?focusedWorklogId=901014&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-901014 ]
ASF GitHub Bot logged work on ARTEMIS-4575: ------------------------------------------- Author: ASF GitHub Bot Created on: 22/Jan/24 18:43 Start Date: 22/Jan/24 18:43 Worklog Time Spent: 10m Work Description: clebertsuconic commented on PR #4754: URL: https://github.com/apache/activemq-artemis/pull/4754#issuecomment-1904594225 I'm actually planning to cut a release this week. I will send a heads up to the dev-list... Issue Time Tracking ------------------- Worklog Id: (was: 901014) Time Spent: 1h 40m (was: 1.5h) > Don't start all previous consumers when new consumer added > ---------------------------------------------------------- > > Key: ARTEMIS-4575 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4575 > Project: ActiveMQ Artemis > Issue Type: Improvement > Affects Versions: 2.31.2 > Reporter: Josh Byster > Assignee: Timothy A. Bish > Priority: Minor > Fix For: 2.32.0 > > Time Spent: 1h 40m > Remaining Estimate: 0h > > I was running a benchmark to add many consumers, and I see that the marginal > cost of adding a new consumer increases due to a linear-time iteration > through all the existing consumers with OpenWire. It becomes very slow to add > a new consumer when there are already 100k+ on a session, for example. We > have thousands of topics and we see a huge performance slowdown due to this. > More specifically, the stack trace: > {code:java} > org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) > java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) > java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) > org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:68) > org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:32) > org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:57) > org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:68) > org.apache.activemq.artemis.utils.actors.ThresholdActor.doTask(ThresholdActor.java:73) > org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection.act(OpenWireConnection.java:369) > org.apache.activemq.command.ConsumerInfo.visit(ConsumerInfo.java:352) > org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor.processAddConsumer(OpenWireConnection.java:1280) > org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection.addConsumer(OpenWireConnection.java:1001) > org.apache.activemq.artemis.core.protocol.openwire.amq.AMQSession.start(AMQSession.java:257) > org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.start(ServerSessionImpl.java:1699) > org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.setStarted(ServerSessionImpl.java:2166) > {code} > {{Most of the time is spent in this method, starting consumers that have > previously been started:}} > {code:java} > private void setStarted(final boolean s) { > Set<ServerConsumer> consumersClone = new HashSet<>(consumers.values()); > for (ServerConsumer consumer : consumersClone) { > consumer.setStarted(s); > } > started = s; > } {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)