GitHub user shoukunhuai opened a pull request:
https://github.com/apache/activemq-artemis/pull/1827
Improve paged message acknowledge
Cache `messageID`, `transactionID` and `isLargeMessage`
in PagedReference, so that when acknowledge, we do not have to
get PagedMessage which may be GCed and cause re-read entire page.
Also, in RefsOperation::afterCommit do not lock queue when do
postAcknowledge. I think this method is thread safe.
And last, decrement ref count after commit only if it is a paged large
message.
Large message depends on this operation to delete file. Other implements
does nothing in this method.
All those change is to avoid get PagedMessage when acknowledge.
Let me know if there is anything wrong.
@clebertsuconic would you please help review this PR? I will create jira
issue when necessary.
Attached is thread dump when doing stress test, we found most of server
thread is blocked on page operation.
We use Artemis 2.4.0, run 10 jmeter engine, for each engine started 100
publisher and 50 subscriber.
We changed jmeter to use shared subscription, and blockOnAcknowledge is set
true.
[jstack.txt](https://github.com/apache/activemq-artemis/files/1680132/jstack.txt)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/shoukunhuai/activemq-artemis enhance-paged-ack
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/activemq-artemis/pull/1827.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 #1827
----
commit 52d63a5802353966236f1f9eec85d577e1941a12
Author: huaishk <shoukunhuai@...>
Date: 2018-01-31T01:48:43Z
Improve paged message acknowledge
Cache `messageID`, `transactionID` and `isLargeMessage`
in PagedReference, so that when acknowledge, we do not have to
get PagedMessage which may be GCed and cause re-read entire page.
Also, in RefsOperation::afterCommit do not lock queue when do
postAcknowledge. I think this method is thread safe.
----
---