qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Queue's various size limits in the C++ broker.
Date Thu, 06 Mar 2014 10:17:28 GMT
On 03/05/2014 09:55 PM, Bill Freeman wrote:
> I've a few concerns about my understanding of the real meaning of the
> various limits on queue content.
> First, let me apologize that my questions need to be interpreted in the
> context of the 0.18 release (upgrades here happen slowly, if at all).
> Please tell me where I've got it wrong below:
> 1. Limits on the number of messages in a queue.
>   I presume that --max-queue-count (qpid.max_count argument in the queue
> properties from QMF) works as a limit against the msgDepth statistic from
> msgDepth is always equivalent to (msgTotalEnqueues - msgTotalDequeues).


> If a message comes in when msgDepth is already (at least) qpid.max_count,
> then the sender receives an exception, the message isn't queued, and the
> broker continues to run normally (even if it is part of a cluster).

Yes, that's the default behaviour. You can set the policy however if you 
wish e.g. the oldest messages to be dropped to make room for the new ones.

> If --max-queue-count is not specified when a queue is created, then
> qpid.max_count doesn't show up in the arguments property, and msgDepth is
> unconstrained.


> 2. Limits on the number of bytes in a queue
> I presume that --max-queue-size (qpid.max_size argument in the queue
> properties) works as a limit against the byteDepth statistic.
> byteDepth is always equivalent to (byteTotalEnqueues - byteTotalDequeues),


> even for durable queues where the message body may only exist in the file,
> and contrary to some documentation of --mas-queue-size that implies that it
> only applies to the in RAM portion of queued messages.

Can you point me at the misleading docs and I'll see if I can make it 

> If a message comes in when byteDepth is already (at least) qpid.max_size,
> then the sender receives an exception, the message isn't queued, and the
> broker continues to run normally (even if it is part of a cluster).

Yes, although as above, a different policy can be chosen for how to 
handle the case where the limit is reached.

> If --max-queue-size is not specified when a queue is created, then
> qpid.max_size doesn't show up in the arguments property, and byteDepth is
> unconstrained.

Actually there is a default max-queue-size, which is set at the broker 
level and applies to all queues that don't set an explicit limit. An 
explicit limit of 0 will give an unconstrained queue.

> 3. Limits on the persistence file.  (You will find some questions here, and
> probably lots of misconceptions.)
> --file-count and --file-size (qpid.file_count and qpid.file_size in the QMF
> argument property), along with an apparently fixed "page" size of 64kiB,
> determine the disk space available to persist this queue.  Each of
> file_count files is file_size pages.
> Are these files pre-allocated, or do they expand to these limits as
> messages get persisted?

Currently they are preallocated. There is a new store (the so called 
'linear store') that allocates files to any queue from a central list, 
and can expand as needed. This is I think available for preview in 0.26, 
but is still undergoing testing and fixing.

> Messages are not perfectly packed in these files, so the number of bytes of
> message that fills this space may be less than the total bytes of disk used.
> Is this difference (last paragraph) because of individual message
> alignments, or because a message can't be split across files in the set, or
> because consumed messages taken from the middle of a file may have that
> space re-used by a smaller message, or some combination?

Its due to the alignment of individual messages, the extra records that 
are added to signal dequeue etc. The journal in the existing store 
('legacy store' so called) is treated as a ring buffer, so removing 
messages from the middle does not actually add any usable space.

> These files only exist for queues marked durable.  Specifying --file-count
> and --file-size for a non-durable queue is ignored.  Is this restriction
> implemented in the broker, in qpid-config, or both?

In the broker only I believe. Its not really a restriction so much as 
the fact that the options won't be looked at if the queue is not durable.

> If I add a durable queue (with qpid-config) but don't specify --file-count
> and --file-size, I still get qpid.file_count = 8 and qpid.file_size = 12,
> as a default size.
> I guess that this default sizing is implemented in qpid-config, because a
> home grown tool here manages to make queues marked durable, but without
> qpid.file_count or qpid.file_size in the arguments property.

That seems to have been changed since 0.18; qpid-config no longer sets 
defaults itself (it will rely on the stores own internal defaults if 
none are specified)

>  Do these
> queues have persistence space, or are they effectively not durable?  If the
> broker provides space for this case, how much?

They are durable, the defaults will be as configured for the store (You 
can see the options with qpidd --help, provided store module is loaded).

> I'm guessing that the file space doesn't directly limit some combination of
> statistics, since, for example (bytePersistEnqueues - bytePersistDequeues)
> may be somewhat short of the total disk size when the disk space, due to
> imperfect packing, becomes full.

Actually in my experience the journals capacity can be significantly 
short of the max queue size. This is in large part due to the nature of 
the journal and all the overheads, alignments and paddings etc, but is 
also because the size of the message on disk is larger than the size 
used to increment the aggregate depth in bytes (this has been adjusted 
in 0.26 to include headers etc, so gets a little closer).

> When the disk space fills, and the broker is part of a cluster, it shuts
> down, rather than refusing the message with an exception to the sender,
> over concerns about correct replication to the other cluster members.  Or
> does this only happen when a replication operation over-fills the file
> space?

The issue is that reaching the journal capacity isn't entirely 
deterministic. It can happen on one node but not the others. When the 
broker gets an error from any node that is not also raised on all the 
others, it shuts down all those that had the error.

> I see some non-durable queues with non-zero values for
> {msg,bytes}Persist{En,De}queues.  Is this because messages marked
> persistent (durable) is what is actually measured by these parameters, even
> when the queue is non-durable, and the messages aren't actually persisted?

The arguments reported by QMF are those that were passed in when the 
queue was created, even if they were not understood or were ignored.

To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org

View raw message