activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Burton <bur...@spinn3r.com>
Subject More ActiveMQ hotspots.. courtesy of continuous profiling :)
Date Tue, 02 Jun 2015 03:02:54 GMT
We deployed a continuous profiler at work today and so far the results look
really interesting.

Definitely worth the investment to setup!

Look like we’re spending 50% of our time here:

org.apache.activemq.broker.jmx.ManagedRegionBroker

    @Override
    public void removeConsumer(ConnectionContext context, ConsumerInfo
info) throws Exception {
        for (Subscription sub : subscriptionMap.keySet()) {
            if (sub.getConsumerInfo().equals(info)) {
               // unregister all consumer subs
               unregisterSubscription(subscriptionMap.get(sub), true);
            }
        }
        super.removeConsumer(context, info);
    }

… so I think a patch for that could be to keep an index around for a map
from ConsumerInfo to Subscription… then unregisterSubscription just has to
factor that in as well.

Another hotspot seems to be:

org.apache.activemq.broker.region.Queue.addToConsumerList(Subscription)

We seem to be spending 5% of our CPU time here due to sorting a list, which
I think can be eliminated.

But 5% isn’t that bad.

There’s also this:

org.apache.activemq.broker.region.AbstractRegion.addSubscriptionsForDestination(ConnectionContext,
Destination)

but it was a small impact and looks harder to optimize.


-- 

Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
<https://plus.google.com/102718274791889610666/posts>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message