How to avoid blocking queue viewing after calling an ActiveMQ checkpoint

The problem when using ActiveMQ with a large number of save queues (250) is 1000 permanent text messages 10 KB.

The scenario requires that these messages remain in the repository for a long time (days) until they are consumed (large amounts of data will be delivered for distribution to many consumers, which can be disconnected for several days).

After saving these messages, and after restarting the broker, we can view / consume some queues until the call #checkpoint is called after 30 seconds.

This call forces the broker to use all available memory and never releases it for other tasks, such as viewing / consuming a queue. Internally, the MessageCursor seems to decide that there is not enough memory and stops delivering the contents of the queue to browsers / consumers.

=> Is there a way to avoid this configuration behavior or is this a bug?

It is expected that we can consume / view any queue under any circumstances.

Below are the settings below, and several recommendations apply in the ActiveMQ documentation (target policies, system accounts, save save settings, etc.).

  • The behavior is tested using ActiveMQ: 5.11.2, 5.13.0 and 5.5.1.
  • Memory Settings: Xmx = 1024 m
  • Java: 1.8 or 1.7
  • OS: Windows, MacOS, Linux
  • PersistenceAdapter: KahaDB or LevelDB
  • : (200 ) ( 16 ).

, (: memoryLimit , , 1mb ):

<destinationPolicy>
    <policyMap>
        <policyEntries>
            <policyEntry queue=">" producerFlowControl="false" optimizedDispatch="true" memoryLimit="128mb" timeBeforeDispatchStarts="1000">
                <dispatchPolicy>
                    <strictOrderDispatchPolicy />
                </dispatchPolicy>
                <pendingQueuePolicy>
                    <storeCursor />
                </pendingQueuePolicy>
            </policyEntry>
        </policyEntries>
    </policyMap>
</destinationPolicy>
<systemUsage>
    <systemUsage sendFailIfNoSpace="true">
        <memoryUsage>
            <memoryUsage limit="500 mb" />
        </memoryUsage>
        <storeUsage>
            <storeUsage limit="80000 mb" />
        </storeUsage>
        <tempUsage>
            <tempUsage limit="1000 mb" />
        </tempUsage>
    </systemUsage>
</systemUsage>

cursorMemoryHighWaterMark destinationPolicy , 150 600, , .

Screenie Oracle Mission Control, ActiveMQTextMessage, :

http://goo.gl/EjEixV

+4
2

() policyEntry.

( ActiveMQ) , memoryLimit, # checkpoint/cleanup, /.

1.)

, memoryLimit ( ) # / / .

, 1024m max-heap 500m memoryLimit.

, - , / / (IMHO).

2.)

, , (KahaDB, LevelDB, JDBC-PostgreSQL).

KahaDB , , .

3.) /

, , .

, :

useCache = "false" expireMessagesPeriod = "0" policyEntry:

<destinationPolicy>
    <policyMap>
        <policyEntries>
            <policyEntry queue=">" producerFlowControl="false" optimizedDispatch="true" memoryLimit="128mb" timeBeforeDispatchStarts="1000"
                                   useCache="false" expireMessagesPeriod="0">
                <dispatchPolicy>
                    <strictOrderDispatchPolicy />
                </dispatchPolicy>
                <pendingQueuePolicy>
                    <storeCursor />
                </pendingQueuePolicy>
            </policyEntry>
        </policyEntries>
    </policyMap>
</destinationPolicy>

, in-mem .

, , .

. 2 . 100 , (. http://activemq.apache.org/per-destination-policies.html).

0

, ActiveMQ " "; ActiveMQ FTP.

manufacturerFlowControl = "true", , ActiveMQ , .

+1

Source: https://habr.com/ru/post/1623436/


All Articles