GitHub user dongeforever opened a pull request:
https://github.com/apache/incubator-rocketmq/pull/57
[ROCKETMQ-91] Reduce lock granularity for putMessage
## Motivation
CommitLog putMessage has a lock as:
```
lockForPutMessage()
try {
.....
} finally {
releasePutMessageLock()
}
```
The logic inside the lock includes two main operations:
1 encode the message
2 write to the PageCache.
However, we can take the first operation(encode message) out from the lock
to achieve better performance.
## Tests
### Env
> Linux 24 Core 48G SSD
> set sendMessageThreadPoolNums=5
> use five async Producers to do stress.
> 50Byte messageï¼send one by one
### Results
reduce before: about **14w TPS**
reduce after: about **16w TPS**
And if we annotate the store layer, only test the network performance, we
got about **17W TPS**.
The bottleneck now is in the network layer.
@zhouxinyu @vongosling @shroman please have a review.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongeforever/incubator-rocketmq up_tps
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-rocketmq/pull/57.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 #57
----
commit b0e8f42ca7463db4d0fb2c25d70b928082898dc3
Author: dongeforever <[email protected]>
Date: 2017-02-10T10:10:09Z
[ROCKETMQ-91] Reduce lock granularity for putMessage
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---