ActiveMQ 日志日志大小

发布于 2024-11-11 03:39:03 字数 461 浏览 1 评论 0原文

我正在使用 KahaDB 持久性适配器运行 ActiveMQ 5.3.0(是的,很快就会升级到 5.4.2,甚至 5.5.0)。它有 7 个队列,大部分时间都是空的,也就是说,一旦消息放入队列,它将在接下来的 5-10 秒内被消耗。然而,处理的消息量相当大(每天几千条消息)。

问题是 KahaDB 数据目录中填充了大量 db-X.log 文件(其中 X 是整数)。每个文件的大小为 32 MB,并且(因为我正在运行几乎默认配置)它们似乎是日志重做日志(因为默认日志文件长度为 32 MB)。它们占用了宝贵的空间(KahaDB 托管在 SSD 卷上)并且看起来是多余的,因为在我看来,日志日志保存着旧的(即出队的)消息。

那么问题是:如何摆脱日志日志文件?我只想 KahaDB 只存储待处理的消息。

正如我所提到的,配置几乎是默认的。 Broker元素仅设置了brokerName和dataDirectory属性,而kahaDB仅设置了directory属性。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

俏︾媚 2024-11-18 03:39:03

如果您使用默认设置,那么这应该已经可以工作了。这些文件保留的唯一原因是如果您的消费者速度较慢且消息正在备份等...

“cleanupInterval”属性控制这些文件清理的频率。默认情况下,这是 30 秒...这是一个将其设置为 5 秒的示例(并将日志大小减少到 100kb 以方便测试)

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

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"/>
北恋 2024-11-18 03:39:03

升级到 5.5.0 以修复 AMQ-2736

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文