[AMQ 7] How does the global-max-size attribute work?
Environment
- Red Hat AMQ (AMQ)
- 7.x
Issue
- How does the paging mechanism work if I have configured the
global-max-size
attribute?
Resolution
The global-max-size
attribute would make the message broker consider the cumulative total of messages across all configured addresses. This means if you have set global-max-size
at 400Mb and deployed four 'addresses', A, B, C and D; the message broker would start paging on all four addresses when the size of A + B + C + D reach the 400Mb mark.
The downside of relying on the global-max-size
attribute is, the destinations with lower message volumes would also start to page messages. For example, let's assume you have configured 400Mb for the global-max-size
attribute and the address A has 200Mb of messages, address B has 100Mb of messages, C has 50Mb of messages and D has 50Mb of messages. In this case, the cumulative total of the messages has reached 400Mb, thus, the message broker would start paging messages for all four destinations although addresses C and D have a lower volume of messages. Therefore, the use of global-max-size might not be appropriate if the configured addresses aren't filling with messages equally. In such situations, configuring max-size-bytes
value at each address can be considered the appropriate approach. The following formula can be used to configure the max-size-bytes
attribute per each address.
Message Broker's Java Heap * 75/100 > (number of destinations * max-size-bytes) + [global-max-size]
The default value for global-max-size is half of the maximum memory available to the Java virtual machine (JVM).
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments