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);