Below is an address named TEST with only one queue named TEST with 100 messages.



The queue persistent size of TEST is 101417600 that is the sum of size of all 
the messages in that queue.

Whereas, the Address size of address TEST is 108900. Can you clarify how this 
value is calculated?

As paging starts when the max size bytes configured for the address TEST 
exceeds this value, I want to understand this to configure the limit 
accordingly.



[cid:image001.png@01DBCF11.DD1E5D70]



[cid:image002.png@01DBCF11.DD1E5D70]





Thanks,

Mohanavalli A





-----Original Message-----
From: Justin Bertram <jbert...@apache.org>
Sent: 23 May 2025 21:25
To: users@activemq.apache.org
Subject: Re: Clarify address-size and how to configure max-size-bytes for 
paging?







Unverified Sender: The sender of this email has not been verified. Review the 
content of the message carefully and verify the identity of the sender before 
acting on this email: replying, opening attachments or clicking links.





> How is address size calculated?



Address size, as in the value reflected in the "Address Size" property of the 
corresponding Address Control, is calculated by inspecting each message as it 
is sent to an address and adding its individual size to a running total. It is 
directly related to paging thresholds and the related address-settings.



> When messages are sent to broker, are the messages present only in

> memory

or they are also written to disk (before paging begins)?



Durable messages (or "persistent" messages in JMS terms) are written to disk 
even in the absence of paging. This is what allows messages to survive a broker 
restart.



> Are only paged messages written to disk?



No.



> How is address size different from Queue persistent size?



Queue persistent size indicates how much data would be received if you consumed 
all the messages in the queue. Think of it like a more fine-grained version of 
"message count."



Keep in mind that the broker is implemented in such a way that a queue simply 
contains a "reference" to an actual message. This is because the same message 
can be in multiple queues simultaneously (e.g. in a multicast

use-case) and we don't want to keep multiple copies of the same data in memory 
as that would be wasteful.



> Why is address size very less compared to Queue persistent size?



I'm not sure what you're asking here. Are you talking about comparing the 
persistent size of one queue on an address with the size of the parent address 
or the total persistent sizes of all the queues on an address with the size of 
the parent address?



> How to calculate the max-size-bytes for a queue based on expected

persistent size for the queue?



The max-size-bytes setting applies to an address, not a queue. The queue's 
persistent size is not directly related to the max-size-bytes setting. That 
setting would correspond to the address's size.



> How to ensure memory is not unnecessary held by messages in DLQ/any

custom error queue?



Simply set max-size-bytes or max-size-messages as necessary for the address. In 
the most extreme case you can set max-size-bytes to 0 so that none of the 
messages will be held in memory (i.e. they will all be paged to disk).





Justin



On Fri, May 23, 2025 at 3:27 AM Mohanavalli A 
<mohanavall...@it.eurofinseu.com.invalid<mailto:mohanavall...@it.eurofinseu.com.invalid>>
 wrote:



> Hi Team,

>

> Can anyone provide clarity on the address-size and other questions in

> below mail?

>

> Thanks,

> Mohanavalli A

>

> From: Mohanavalli A

> Sent: 20 May 2025 08:53

> To: users@activemq.apache.org<mailto:users@activemq.apache.org>

> Subject: Clarify address-size and how to configure max-size-bytes for

> paging?

>

> Hi Team,

>

> We have the max-size-bytes configured as -1 in the address-setting and

> global-max-size as 1/5th of the broker xmx.

> Recently we had a situation of DLQ with more messages, which caused

> paging of all addresses affecting broker performance. To avoid such

> situation, we want to configure max-size-bytes for DLQ with a lower

> value so that DLQ messages do not cause paging of other addresses. Can

> you clarify below

>

>

>   *   How is address size calculated?

>   *   When messages are sent to broker, are the messages present only in

> memory or they are also written to disk (before paging begins)?

>   *   Are only paged messages written to disk?

>   *   How is address size different from Queue persistent size?

>   *   Why is address size very less compared to Queue persistent size? How

> to calculate the max-size-bytes for a queue based on expected

> persistent size for the queue?

>   *   How to ensure memory is not unnecessary held by messages in DLQ/any

> custom error queue?

>

> Thanks,

> Mohanavalli A

>

>

Reply via email to