Also, while this is a small performance boost in my example, this should have a massive impact when running with large queues. It’s calling Timer.purge() on each queue GC and if you have a lot of queues you’re going to have a lot of TimerTasks so this is a O(N). It also holds a global lock during this operation so no new queues can be created during a queue GC.
On Sat, May 2, 2015 at 12:23 PM, Kevin Burton <[email protected]> wrote: > I’m doing a bunch of performance analysis of ActiveMQ this weekend to see > if I can improve queue creation and destruction time. The good news is > that there are a lot of areas of optimization. > > It looks like one is that advisory topics are created with the default > expireMessagesPeriod (which is 30000). However, no advisory messages are > produced with TTLs. > > I believe this is done in AdvisoryBroker.fireAdvisory > > … looking at this code, a TTL isn’t set. So I think that it would be a > good idea to enable expireMessagesPeriod=0 for advisory topics. > > Here’s the code if you’re interested: > > http://pastebin.com/i3hXDGEW > > Looks like the following policyEntry works as a proof of concept. > > <policyEntry topic=">" > prioritizedMessages="false" > useCache="false" > maxBrowsePageSize="2147483647" > expireMessagesPeriod="0"> > > </policyEntry> > > (I am going to constrain it for advisory topics though). > > In my test time time for GCing all my queues went from 45s to 17s. It’s > MUCH higher than this under production load though due threading issues. > > Are there any potential issues I might be missing here? > > If this works I might try to submit a patch to disable > expireMessagesPeriod by default for advisory topics. > > -- > > 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> > > -- 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>
