18.5. Paging
18.5.1. About Paging
Note
18.5.2. Page Files
page-size-bytes
).
Note
18.5.3. Configuration of Paging Folder
paging-directory
parameter:
<hornetq-server> ... <paging-directory>/location/paging-directory</paging-directory> ... </hornetq-server>The
paging-directory
parameter is used to specify a location/folder to store the page files. HornetQ creates one folder for each paging address in this paging directory. The page files are stored in these folders.
EAP_HOME/standalone/data/messagingpaging
(standalone mode) and EAP_HOME/domain/servers/SERVERNAME/data/messagingpaging
(domain mode).
18.5.4. Paging Mode
Note
max-size-bytes
for an address, it means each matching address will have a maximum size that you specified. However it does not mean that the total overall size of all matching addresses is limited to max-size-bytes
.
page
mode, the server may crash due to an out-of-memory error. HornetQ keeps a reference to each page file on the disk. In a situation with millions of page files, HornetQ can face memory exhaustion. To minimize this risk, it is important to set the attribute page-size-bytes
to a suitable value. You must configure the memory for your JBoss EAP 6 server higher than (number of destinations)*(max-size-bytes)
, otherwise an out-of-memory error can occur.
max-size-bytes
) for an address in server configuration files (standalone.xml
and domain.xml
):
<address-settings> <address-setting match="jms.someaddress"> <max-size-bytes>104857600</max-size-bytes> <page-size-bytes>10485760</page-size-bytes> <address-full-policy>PAGE</address-full-policy> </address-setting> </address-settings>The following table describes the parameters on the address settings:
Element | Default Value | Description |
---|---|---|
max-size-bytes | 10485760 |
This is used to specify the maximum memory size the address can have before entering nto paging mode
|
page-size-bytes | 2097152 |
This is used to specify the size of each page file used on the paging system.
|
address-full-policy | PAGE |
This value of this attribute is used for paging decisions. You can set either of these values for this attribute:
PAGE : To enable paging and page messages beyond the set limit to disk, DROP : To silently drop messages which exceed the set limit, FAIL : To drop messages and send an exception to client message producers, BLOCK : To block client message producers when they send messages beyond the set limit
|
page-max-cache-size | 5 |
The system will keep page files up to
page-max-cache-size in memory to optimize Input/Output during paging navigation
|
Important
address-full-policy
to DROP
, FAIL
and BLOCK
respectively. In the default configuration, all addresses are configured to page messages after an address reaches max-size-bytes
.
When a message is routed to an address that has multiplte queues bound to it, there is only a single copy of the message in memory. Each queue only handles a reference to this original copy of the message. Thus the memory is freed up only when all the queues referencing the original message, have delivered the message.
Note