0
votes

From time to time under heavy load we can observe a slowdown in sending JMS messages. Sometimes sending a simple message can take up to 30 secs. The first thing we noticed is enormous size of journal files 9.5GB in all. 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 - i.e. has all its data been deleted in the same or other files. If so, the file can be reclaimed and re-used

But we see a lot of files in the journals folder. Can it influence performance of sending messages?

UPDATE

We are using embedded JMS server version 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);
1
Can you provide your full broker.xml? What version of Artemis are you using? - Justin Bertram
@JustinBertram I've updated the question with version and settings - alniks

1 Answers

0
votes

The first thing that comes to mind is that since journal-pool-files defaults to -1 and journal-file-size defaults 10485760 bytes (i.e. 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. 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.