osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] activemq pull request #295: AMQ-7028 - Disable concurrentStoreAndDispatchQue...


GitHub user alanprot opened a pull request:

    https://github.com/apache/activemq/pull/295

    AMQ-7028 - Disable concurrentStoreAndDispatchQueues for slow consumers

    Using high latency FS (as NFS) to store kahadb files and setting concurrentStoreAndDispatchQueues=true may cause poor performance for slow consumer. This happens because using this option makes activemq write the produced messages one by one to the underlying file system (this is implemented by using a SingleThread ExecutorService).
    
    Lets say that for each write to the FS takes 10ms and the queue has slow consumers. In this case, does not matter the number of concurrent messages the producers try to send to the queue, the maximum performance we can achieve is 100 TPS. Tuning this flag off, we can see a really better performance for sending messages in parallel as those messages can be batched to the FS in a single write (the performance increases with the number of concurrent messages being sent in parallel).
    
    Looking at Activemq code we found that there is an flag used on levelDb to detect if the queue has fast or slow consumers, and decide if it will use concurrentStoreAndDispach or not.
    
    https://issues.apache.org/jira/browse/AMQ-3750
    
    but this flag is not used on the KahaDb implementation.
    
    We made a code change to receive the flag in the KahaDbStore and use it to decide if the message will be stored async or not.
    
    We think that there is no reason to try to "StoreAndDispatch" if the destination has slow consumers. This only brings overhead and in case of high latency FS, really poor performance when the queue has slow consumer.
    
    For fast consumers, this change will have no effect giving the better of the 2 options.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/alanprot/activemq activemq-5.15.x

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq/pull/295.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #295
    
----
commit 63c21ffb730e666728e19b9079b68c0e8177d6f5
Author: Alan Protasio <alanprot@...>
Date:   2018-08-01T20:50:26Z

    AMQ-7028 - Disable concurrentStoreAndDispatchQueues for slow consumers

----


---