3.2. Setting the Store Journal Size
It is important to set the store journal size to match the anticipated persistent message queue depth. Since the store uses a fixed-size circular file buffer, it is possible for the store to run out of space to enqueue messages if consumers are slow or messages are too large.
Each queue that is marked persistent will cause the broker to create an instance of the store together with its files. The broker will stop accepting persistent messages when approximately 80% of the journal capacity is reached. Consuming of messages (dequeueing), however will be allowed to continue. Once the dequeued messages have cleared sufficient space, enqueues will continue normally. Allowing messages to dequeue will free space in the journal. It is particularly important to dequeue the earliest messages in the journal as early as possible, as these will hold up the write process in the buffer.
As a rule of thumb, the journal capacity should be about 25% greater than the total persistent message size expected to be stored on the disk at any one moment in time.
| Options for setting the store journal size | |
|---|---|
--num-jfiles
|
Set the number of files for each instance of the persistence journal. The default is 8. |
-jfile-size-pgs
|
Set the size of each journal file in multiples of 64KB. The default is 24. |
A totally full condition on the journal (in which there is no more write space in the circular buffer) is a fatal condition. It is possible to read the messages in a full journal, but not to dequeue them (as dequeueing requires the ability to write dequeue records). For this reason further enqueues are disabled at 80% capacity.