You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by qpid_user <kn...@yahoo.com> on 2009/04/13 08:15:21 UTC

how to resolve Enqueue capacity threshold exceeded error

we are trying to send 10000 messages of around 2720 bytes on test basis
when direct_producer is executed following error occurs:

2009-apr-13 10:21:29 warning Broker closed connection: 501, Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)
framing-error: Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)

-- 
View this message in context: http://n2.nabble.com/how-to-resolve-Enqueue-capacity-threshold-exceeded-error-tp2626671p2626671.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: how to resolve Enqueue capacity threshold exceeded error

Posted by Gordon Sim <gs...@redhat.com>.
Kim van der Riet wrote:
> On Wed, 2009-04-15 at 09:44 +0100, Gordon Sim wrote:
> 
>> I.e. you need at least 272,000,000 bytes capacity. The default 'page 
>> size' is 32k so each file will be 128*32k=4096k, and 64 files of that 
>> size would give you 262,144,000. I think you may run out of space even 
>> with those settings.
> 
> The file size parameter (as specified in the help) is in read pages,
> each of which is 64k (the write page cache is 32k). 

Oops! I do apologise for stating incorrect information!



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: how to resolve Enqueue capacity threshold exceeded error

Posted by Kim van der Riet <ki...@redhat.com>.
On Wed, 2009-04-15 at 09:44 +0100, Gordon Sim wrote:

> I.e. you need at least 272,000,000 bytes capacity. The default 'page 
> size' is 32k so each file will be 128*32k=4096k, and 64 files of that 
> size would give you 262,144,000. I think you may run out of space even 
> with those settings.

The file size parameter (as specified in the help) is in read pages,
each of which is 64k (the write page cache is 32k). A setting of 128
will yield a file of 8 MiB each. Using 64 files (the current max because
of file handle limit concerns) will give a total per-queue file capacity
of 512 MiB. This is going to take time to initialize  - probably several
seconds each time a queue of this size is declared.

The current file count limits are 4-64, the current file size limits are
1-32768 (which translates to 64 kiB - 2 GiB each). Combined, the current
store size limit is 128 GiB per queue.

Here is a brief explanation of the workings and reasoning behind this
system:

The store creates a circular buffer from the files. Because the process
of dequeueing records involves writing a dequeue record which logically
invalidates a previous enqueue record (rather than literally erasing an
old record), a full store is a fatal condition because neither enqueues
nor dequeues may take place. For this reason, an approximately 80% full
limit is set on enqueues - the idea being that when the store is this
full, allowing only dequeues can free up space which will eventually
allow enqueues to continue.

A further rule of the circular buffer is that no file that contains any
still enqueued record may be written, even if the enqueued record is
right at the end of the file. This safeguards the integrity of the data
in the store - as crucial recover information would be overwritten in
the file header as soon as the next write in that file occurs.

The mechanism employed by the store to check this limit is to look ahead
from the current write position plus the proposed write size in the
store by 20% of the total capacity of the journal and make sure that the
file at this position is writable - ie contains no enqueued records. As
soon as this test fails, the Enqueue Capacity exception is thrown to the
enqueueing application. Because the entire file at the +20% position
must be free of enqueues, the exact mathematical percentage of the
journal's capacity this represents can vary depending on the size of the
files, their number and where the last record is located in the file.
For a large number of files (such as the 64 you are now using), this
will be fairly close to 80%, but for a small file count, this can be as
low as 50%.

Correctly sizing the store up-front is obviously important. To do so, it
is necessary to correctly estimate the maximum queue depth in bytes. As
a rough rule of thumb, the journal should be at least twice the maximum
anticipated queue depth. (If disk space and/or queue declare latencies
are critical, it is possible to reduce this if the parameters are
carefully controlled.) Being a circular buffer, however, it is also
important that the message consumers be well-behaved - ie consumers
acknowledge the messages they have received promptly. If a consumer
requests a message, but delays in acknowledging it after receiving it,
then the store must hold on to that message, and it can remain long
after the messages around it have been dequeued. This will eventually
cause the store to throw the enqueue threshold exception because this
remaining record cannot be overwritten until its receipt has been
acknowledged by the consumer. Gordon - you may be able to clarify this
further in API terms better.

Rather a long explanation, but I hope it will shed some light on the
store and its limitations.

K


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: how to resolve Enqueue capacity threshold exceeded error

Posted by Gordon Sim <gs...@redhat.com>.
qpid_user wrote:
> please let me know what is incorrect in  the following declare_queues.cpp code:
>                   :
>                   :
>     FieldTable pers;
>     pers.setInt("file_size", 128);
>     pers.setInt("file_count", 64);

I believe this should be:


      pers.setInt("qpid.file_size", 128);
      pers.setInt("qpid.file_count", 64);

>     try {
>       connection.open(host, port);
>       Session session =  connection.newSession();
>       session.queueDeclare(arg::queue="message_queue", arg::durable=true, arg::arguments=pers);
>                    :
>                    :
> I execute broker with  following command
> ./qpidd -p 5004 --auth no --default-queue-limit 0 --load-module msgstore.so
> and producer sends 100000 persistent messages, each msg being 2720Bytes size.

I.e. you need at least 272,000,000 bytes capacity. The default 'page 
size' is 32k so each file will be 128*32k=4096k, and 64 files of that 
size would give you 262,144,000. I think you may run out of space even 
with those settings.

> producer throws error:
> 2009-apr-15 10:58:35 warning Broker closed connection: 501, Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)
> framing-error: Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)
> 
> Thanks
> 
> 
> 
> The two agrs are  "qpid.file_count"  & "qpid.file_size"  used on queue 
> declare.
> 
> Carl.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: how to resolve Enqueue capacity threshold exceeded error

Posted by qpid_user <kn...@yahoo.com>.
hi Carl

please let me know what is incorrect in  the following declare_queues.cpp code:
                  :
                  :
    FieldTable pers;
    pers.setInt("file_size", 128);
    pers.setInt("file_count", 64);
    try {
      connection.open(host, port);
      Session session =  connection.newSession();
      session.queueDeclare(arg::queue="message_queue", arg::durable=true, arg::arguments=pers);
                   :
                   :
I execute broker with  following command
./qpidd -p 5004 --auth no --default-queue-limit 0 --load-module msgstore.so
and producer sends 100000 persistent messages, each msg being 2720Bytes size.

producer throws error:
2009-apr-15 10:58:35 warning Broker closed connection: 501, Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)
framing-error: Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)

Thanks



The two agrs are  "qpid.file_count"  & "qpid.file_size"  used on queue 
declare.

Carl.
-- 
View this message in context: http://n2.nabble.com/how-to-resolve-Enqueue-capacity-threshold-exceeded-error-tp2626671p2637032.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: how to resolve Enqueue capacity threshold exceeded error

Posted by Carl Trieloff <cc...@redhat.com>.
The two agrs are  "qpid.file_count"  & "qpid.file_size"  used on queue 
declare.

Carl.




qpid_user wrote:
> I did try with qpid-config its works you have mentioned same setting of file-size and file-count can be done programatically, how to do the same? 
> I did check LocalQueue class for the same but therez no function which will set file-size or file-count..
>
>
>
> When you declare the queues via qpid-tool you can also use
>
>     --file-count N (8)   Number of files in queue's persistence journal
>     --file-size  N (24)  File size in pages (64Kib/page)
>
> to set the storage for the queue, or if declared via code can be passed 
> as arguments.
>
> The store uses a mechanism of pre-allocation for max queue size, queues 
> can be
> declared with alternate sizes etc... but this is what you ran into. In a 
> later version I
> believe the ability to auto-expand will be supported.
>
> Carl.
>
>
>
> qpid_user wrote:
>   
>> after referring to an pdf on amqp i did following::
>>  ./qpidd --num-jfiles 64 --jfile-size-pgs 128 -p 5004 --auth no --default-queue-limit 0 --load-module msgstore.so
>> i could send 400000 messages also. 
>> My query is now if an application sends messages continuously and the datasize varies anywhere between 200 Bytes - 2048 Bytes. could anyone tell me what should be appropriate value of --num-jfiles & --jfile-size-pgs flags?
>> is there any other option to be added while executing broker(qpidd)?
>>
>> I read the explaination given on https://store.redhat.com/docs/en-US/Red_Hat_Enterprise_MRG/1.1/html/Messaging_User_Guide/chap-Messaging_User_Guide-Persistence.html
>> but did not get an clear idea as to why are these persistence options required?  
>> could anyone please explain me the same?
>>  
>>
>>
>> we are trying to send 10000 messages of around 2720 bytes on test basis
>> when direct_producer is executed following error occurs:
>>
>> 2009-apr-13 10:21:29 warning Broker closed connection: 501, Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)
>> framing-error: Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)
>>
>>
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>
>
>
>   


Re: how to resolve Enqueue capacity threshold exceeded error

Posted by qpid_user <kn...@yahoo.com>.
I did try with qpid-config its works you have mentioned same setting of file-size and file-count can be done programatically, how to do the same? 
I did check LocalQueue class for the same but therez no function which will set file-size or file-count..



When you declare the queues via qpid-tool you can also use

    --file-count N (8)   Number of files in queue's persistence journal
    --file-size  N (24)  File size in pages (64Kib/page)

to set the storage for the queue, or if declared via code can be passed 
as arguments.

The store uses a mechanism of pre-allocation for max queue size, queues 
can be
declared with alternate sizes etc... but this is what you ran into. In a 
later version I
believe the ability to auto-expand will be supported.

Carl.



qpid_user wrote:
> after referring to an pdf on amqp i did following::
>  ./qpidd --num-jfiles 64 --jfile-size-pgs 128 -p 5004 --auth no --default-queue-limit 0 --load-module msgstore.so
> i could send 400000 messages also. 
> My query is now if an application sends messages continuously and the datasize varies anywhere between 200 Bytes - 2048 Bytes. could anyone tell me what should be appropriate value of --num-jfiles & --jfile-size-pgs flags?
> is there any other option to be added while executing broker(qpidd)?
>
> I read the explaination given on https://store.redhat.com/docs/en-US/Red_Hat_Enterprise_MRG/1.1/html/Messaging_User_Guide/chap-Messaging_User_Guide-Persistence.html
> but did not get an clear idea as to why are these persistence options required?  
> could anyone please explain me the same?
>  
>
>
> we are trying to send 10000 messages of around 2720 bytes on test basis
> when direct_producer is executed following error occurs:
>
> 2009-apr-13 10:21:29 warning Broker closed connection: 501, Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)
> framing-error: Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)
>
>
>
>   


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org




-- 
View this message in context: http://n2.nabble.com/how-to-resolve-Enqueue-capacity-threshold-exceeded-error-tp2626671p2627595.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: how to resolve Enqueue capacity threshold exceeded error

Posted by Carl Trieloff <cc...@redhat.com>.

When you declare the queues via qpid-tool you can also use

    --file-count N (8)   Number of files in queue's persistence journal
    --file-size  N (24)  File size in pages (64Kib/page)

to set the storage for the queue, or if declared via code can be passed 
as arguments.

The store uses a mechanism of pre-allocation for max queue size, queues 
can be
declared with alternate sizes etc... but this is what you ran into. In a 
later version I
believe the ability to auto-expand will be supported.

Carl.



qpid_user wrote:
> after referring to an pdf on amqp i did following::
>  ./qpidd --num-jfiles 64 --jfile-size-pgs 128 -p 5004 --auth no --default-queue-limit 0 --load-module msgstore.so
> i could send 400000 messages also. 
> My query is now if an application sends messages continuously and the datasize varies anywhere between 200 Bytes - 2048 Bytes. could anyone tell me what should be appropriate value of --num-jfiles & --jfile-size-pgs flags?
> is there any other option to be added while executing broker(qpidd)?
>
> I read the explaination given on https://store.redhat.com/docs/en-US/Red_Hat_Enterprise_MRG/1.1/html/Messaging_User_Guide/chap-Messaging_User_Guide-Persistence.html
> but did not get an clear idea as to why are these persistence options required?  
> could anyone please explain me the same?
>  
>
>
> we are trying to send 10000 messages of around 2720 bytes on test basis
> when direct_producer is executed following error occurs:
>
> 2009-apr-13 10:21:29 warning Broker closed connection: 501, Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)
> framing-error: Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)
>
>
>
>   


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: how to resolve Enqueue capacity threshold exceeded error

Posted by qpid_user <kn...@yahoo.com>.
after referring to an pdf on amqp i did following::
 ./qpidd --num-jfiles 64 --jfile-size-pgs 128 -p 5004 --auth no --default-queue-limit 0 --load-module msgstore.so
i could send 400000 messages also. 
My query is now if an application sends messages continuously and the datasize varies anywhere between 200 Bytes - 2048 Bytes. could anyone tell me what should be appropriate value of --num-jfiles & --jfile-size-pgs flags?
is there any other option to be added while executing broker(qpidd)?

I read the explaination given on https://store.redhat.com/docs/en-US/Red_Hat_Enterprise_MRG/1.1/html/Messaging_User_Guide/chap-Messaging_User_Guide-Persistence.html
but did not get an clear idea as to why are these persistence options required?  
could anyone please explain me the same?
 


we are trying to send 10000 messages of around 2720 bytes on test basis
when direct_producer is executed following error occurs:

2009-apr-13 10:21:29 warning Broker closed connection: 501, Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)
framing-error: Enqueue capacity threshold exceeded on queue "message_queue". (JournalImpl.cpp:575)



-- 
View this message in context: http://n2.nabble.com/how-to-resolve-Enqueue-capacity-threshold-exceeded-error-tp2626671p2627322.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org