activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Burton <bur...@spinn3r.com>
Subject Re: Setting expireMessagesPeriod=0 for advisory topics improved GC performance by 2x..
Date Sat, 02 May 2015 23:33:34 GMT
I’m confused by something.  Why don’t messages pile up in advisory topics?
Topics only deliver messages to consumers who are actually listening I
assume?

On Sat, May 2, 2015 at 2:07 PM, Kevin Burton <burton@spinn3r.com> wrote:

> I’m sorry.. this is N^2 because the Timer just keeps growing for every new
> queue and they need to be purged and it has to evaluate each one.
>
> On Sat, May 2, 2015 at 1:40 PM, Kevin Burton <burton@spinn3r.com> wrote:
>
>> 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 <burton@spinn3r.com> 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>
>>
>>
>
>
> --
>
> 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>

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