ActiveMQ 日志日志大小
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用默认设置,那么这应该已经可以工作了。这些文件保留的唯一原因是如果您的消费者速度较慢且消息正在备份等...
“cleanupInterval”属性控制这些文件清理的频率。默认情况下,这是 30 秒...这是一个将其设置为 5 秒的示例(并将日志大小减少到 100kb 以方便测试)
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)
升级到 5.5.0 以修复 AMQ-2736。
Upgrade to 5.5.0 to get the fix for AMQ-2736.