简体   繁体   English

Apache ActiveMQ Artemis速度下降

[英]Apache ActiveMQ Artemis slowdown

From time to time under heavy load we can observe a slowdown in sending JMS messages. 在不堪重负的情况下,我们有时会发现发送JMS消息的速度有所下降。 Sometimes sending a simple message can take up to 30 secs. 有时发送一条简单的消息最多可能需要30秒。 The first thing we noticed is enormous size of journal files 9.5GB in all. 我们注意到的第一件事是总计9.5GB的巨大日志文件。 Why are there so many files and are there any settings that influence the number of files. 为什么会有这么多文件,并且有任何影响文件数量的设置。 According to docs: 根据文档:

Apache ActiveMQ Artemis has a sophisticated file garbage collection algorithm which can determine if a particular journal file is needed any more - ie has all its data been deleted in the same or other files. Apache ActiveMQ Artemis具有完善的文件垃圾收集算法,该算法可以确定是否进一步需要特定的日志文件-即是否已将其所有数据删除到相同或其他文件中。 If so, the file can be reclaimed and re-used 如果是这样,可以回收和重新使用该文件

But we see a lot of files in the journals folder. 但是我们在journals文件夹中看到很多文件。 Can it influence performance of sending messages? 它会影响发送消息的性能吗?

UPDATE UPDATE

We are using embedded JMS server version 2.3.0. 我们正在使用嵌入式JMS服务器版本2.3.0。 Here are some of the configs we set: 这是我们设置的一些配置:

config.setPersistenceEnabled(true);
config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
config.getConnectorConfigurations().put("connector", new TransportConfiguration(InVMConnectorFactory.class.getName()));
AddressSettings addressSettings = new AddressSettings();
    addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
    addressSettings.setMaxSizeBytes(30 * 1024 * 1024L);
    addressSettings.setPageSizeBytes(10 * 1024 * 1024L);
    addressSettings.setPageCacheMaxSize(20);
    config.getAddressesSettings().put("jms.queue.*", addressSettings);
    config.setJournalBufferSize_AIO(819200);
    config.setJournalBufferSize_NIO(819200);

The first thing that comes to mind is that since journal-pool-files defaults to -1 and journal-file-size defaults 10485760 bytes (ie 10MB) the broker is having to create and initialize 10MB files during runtime as messages accumulate, and once those files are created the journal will not shrink back to a smaller set of files as messages are consumed. 首先想到的是,由于journal-pool-files默认为-1journal-file-size默认为10485760字节(即10MB),代理必须在运行时随着消息的累积创建和初始化10MB文件,并且一次创建这些文件后,日记将不会随着邮件的使用而缩减为较小的文件集。 Creating and initializing files is an expensive operation so you should tune the journal so that you have enough files pre-created to deal with your expected message volume. 创建和初始化文件是一项昂贵的操作,因此您应该调整日志,以便预先创建足够的文件来处理预期的消息量。 See the Apache Artemis documentation on the journal for more details. 有关更多详细信息,请参见期刊上Apache Artemis文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM