You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2022/08/24 12:53:44 UTC
[GitHub] [activemq-artemis] clebertsuconic commented on a diff in pull request #4185: ARTEMIS-3943 Adjusting defalut address settings to avoid OME from paging and flow control
clebertsuconic commented on code in PR #4185:
URL: https://github.com/apache/activemq-artemis/pull/4185#discussion_r953763854
##########
artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml:
##########
@@ -144,10 +144,14 @@ ${cluster-security.settings}${cluster.settings}${replicated.settings}${shared-st
<!-- the size of each file on paging. Notice we keep files in memory while they are in use.
Lower this setting if you have too many queues in memory. -->
<page-size-bytes>10M</page-size-bytes>
- <!-- how many messages are kept in memory from paging. The system will stop reading whenever this or max-read-page-bytes hits the max first. -->
- <max-read-page-messages>1000</max-read-page-messages>
+ <!-- how many messages are kept in memory from paging. The system will stop reading whenever this or max-read-page-bytes hits the max first.
+ Change it to a positive value if you want to limit the number of messages read.-->
+ <max-read-page-messages>-1</max-read-page-messages>
<!-- how many bytes equivalent of messages are kept in memory from paging (based on memory estimate). The system will stop reading whenever this or max-read-page-messages hits the max first. -->
<max-read-page-bytes>1M</max-read-page-bytes>
+ <!-- The system will not read any more messages if messages are pending acks.
+ if you set this attribute to false, the broker will allow more reading as soon as messages become on "delivering" state. -->
+ <page-read-flow-control>true</page-read-flow-control>
Review Comment:
The reading is always per address.. we don't control a global-max-read...
I need the attribute for the following reason:
if this attribute is false, the max-read-page-bytes still used, however as soon as the message left the queue, the message will open space for reading more messages.
With that semantic in place, as soon as the client sends credits, the messages will be delivered and that will open space for more messages to be read.
Say, the following example:
```java
Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
MessageConsumer consumer = session.createConsumer(session.createQueue("myQueue"));
for (int I = 0; I < 1000; I++) {
Message message = consumer.receive();
}
session.commit();
```
on such example ^^^^^ if I set page-read-flow-control to true, the more messages the client request, the more messages are going to be delivered to the client.
if I set this to false, the receive() might block if you don't have enough memory in the queue... for that reason the users will have to decide on what type of consumers they have.
if you have a well behaved consumer, page-read-flow-control=false still valid and it should work.. however when you have unbehaved clients this value must be true.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org