Optimizing HornetQ
Up to now, we mostly discussed optimizations that can be done using standard JMS functionalities. In the rest of the chapter, we will focus on HornetQ-specific optimizations that can be used in WildFly.
Persistence storage tuning
As HornetQ uses a journal (basically a set of binary files) located on disk for persistent storage of messages, the first thing is to make sure is that the files are placed on their own dedicated physical disk(s). Any other I/O to that disk may harm performance as it will compete with HornetQ to control the disk head. This is very important as the HornetQ journal is an append-only journal, and moving the disk head will have a serious impact on performance. The journaling directory can be changed by the following CLI command (exchange the path value for your absolute path):
/subsystem=messaging/hornetq-server=default/path=journal-directory:write-attribute(name=path, value="/path/to/journal/files")
Whenever a journal file is created, it...