You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@rocketmq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/02/10 11:25:41 UTC

[jira] [Commented] (ROCKETMQ-91) Reduce lock granularity for putMessage

    [ https://issues.apache.org/jira/browse/ROCKETMQ-91?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15861143#comment-15861143 ] 

ASF GitHub Bot commented on ROCKETMQ-91:
----------------------------------------

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 <zh...@yeah.net>
Date:   2017-02-10T10:10:09Z

    [ROCKETMQ-91] Reduce lock granularity for putMessage

----


> Reduce lock granularity for putMessage
> --------------------------------------
>
>                 Key: ROCKETMQ-91
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-91
>             Project: Apache RocketMQ
>          Issue Type: Improvement
>    Affects Versions: 4.1.0-incubating
>            Reporter: dongeforever
>            Assignee: dongeforever
>             Fix For: 4.1.0-incubating
>
>
> CommitLog putMessage has a lock as:
> lockForPutMessage()
> ....
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)