开发者

ActiveMQ journal log size

I'm running ActiveMQ 5.3.0 (yup, gonna upgrade to 5.4.2, or even 5.5.0 soon) with KahaDB persistence adapter. It has 7 queues which are most of the time empty, that is, once message is put on queue it is being consumed in next 5-10 seconds. However volume of messages going thrugh is considerable (few 开发者_如何转开发thousands messages per day).

The problem is that KahaDB data directory is populated with numerous db-X.log files (where X is a integer). Every file is 32 MB in size and (since i'm running pretty much default configuration) it appears they are a journal redo logs (because default journal file length is 32mb). They take up valuable space (KahaDB is hosted on SSD volume) and seem redundant, since it seems to me that journal logs hold old (that is, dequeued) messages.

So the question is: how to get rid of journal log files? I just want KahaDB to store only pending messages.

As I have mentioned configuration is pretty much default. Broker element has only brokerName and dataDirectory attributes set, while kahaDB has only directory attribute set.


If you are using the default settings, then this should be working already. The only reason these files would remain is if you have a slow consumer and messages are backing up, etc...

The "cleanupInterval" attribute controls how frequently these files get cleaned up. By default, this is 30s...here is an example that sets it to 5 seconds (and reduces the journal size to 100kb for easier testing)

<kahaDB directory="${activemq.base}/data/kahadb" 
        journalMaxFileLength="100kb" 
        cleanupInterval="5000"/>


Upgrade to 5.5.0 to get the fix for AMQ-2736.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜