[ActiveMQ Tuning] Serializing to Disk

Source: Internet
Author: User

From: http://fusesource.com/docs/broker/5.4/tuning/PersTuning-SerialToDisk.html

KahaDB message store: KahaDB is a message storage mechanism recommended by ActiveMQ Broker for high performance. KahaDB supports multiple performance options for you to adjust to achieve optimal performance.

Normal dispatching through a persistent broker (conventional distribution of persistent brokers): Figure2.1 general distribution of persistent Brokers

After receiving a message from the Producer, the Broker sends the message to the consumer according to the following steps:

  1. The Broker stores the Message in the Message Store. IfenableJournalDiskSyncsIstrueThe message will be stored on the disk before borker continues processing.
  2. Now the Broker sends a message to all interested consumers (but you do not need to wait for confirmation). Topics sends the message immediately, while Queue adds the message to a target Cursor (Cursor) from the Broker)
  3. The Broker gives the Producer a receipt feedback.
Concurrent store and dispatch: To improve the Broker performance, you can set Concurrent store and dispatchOption to store and send messages to consumers at the same time.

The Figure 2.2 chart shows parallel operations for message storage and distribution. (The original article is 2.1. I personally feel wrong)

Figure 2.2. Concurrent Store and Dispatch

 

 

After receiving a message from the Producer, the Broker sends the message to the consumer according to the following steps:

  1. The Broker stores the Message in the Message Store and sends the Message to all interested consumers (consumer). After the Message is sent, the Broker gives the Producer a receipt feedback, this feedback does not need to wait for the consumer's confirmation or whether the message has been serialized to the disk.
  2. After receiving all consumer feedback, the Broker removes the message from the message storage. The consumer feedback is usually faster than the message stored on the disk, which means the steps for storing the message to the disk will be optimized. This is because the message will be removed from the message storage before it is stored on the disk.
Processing ing concurrent store and dispatch: the features of concurrent store and dispatch are concurrentStoreAndDispatchQueuesAnd concurrentStoreAndDispatchTopics. By default, the Queue is set to True, but the Topic is set to false. To set it to true, configure the kahaDB item in the Broker as follows:
<broker brokerName="broker" persistent="true" useShutdownHook="false">
  ...
  <persistenceAdapter>
    <kahaDB directory="activemq-data"
            journalMaxFileLength="32mb"
            concurrentStoreAndDispatchQueues="true"
            concurrentStoreAndDispatchTopics="true"
            />
  </persistenceAdapter>
</broker>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.