You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by qinliujie <gi...@git.apache.org> on 2017/01/07 02:41:24 UTC

[GitHub] incubator-rocketmq pull request #31: [ROCKETMQ-34] CPU Occupy 100%

GitHub user qinliujie opened a pull request:

    https://github.com/apache/incubator-rocketmq/pull/31

    [ROCKETMQ-34] CPU Occupy 100%

    https://issues.apache.org/jira/browse/ROCKETMQ-33

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

    $ git pull https://github.com/qinliujie/incubator-rocketmq master

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

    https://github.com/apache/incubator-rocketmq/pull/31.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 #31
    
----
commit 48b3277dccba96b1d12744ce31dfd045aff134a7
Author: nantian <na...@juanpi.com>
Date:   2017-01-07T02:36:49Z

    [ROCKETMQ-34] CPU Occupy 100%
    https://issues.apache.org/jira/browse/ROCKETMQ-33

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #31: [ROCKETMQ-33] CPU Occupy 100%

Posted by Jaskey <gi...@git.apache.org>.
Github user Jaskey commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/31
  
    I agreee with @Ah39  , 0ms is wait forever, which should not cause high cpu problem, any other justice reason to modify it to 10ms?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq pull request #31: [ROCKETMQ-33] CPU Occupy 100%

Posted by zhouxinyu <gi...@git.apache.org>.
Github user zhouxinyu commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/31#discussion_r95059881
  
    --- Diff: store/src/main/java/org/apache/rocketmq/store/CommitLog.java ---
    @@ -1045,7 +1045,7 @@ public void run() {
     
                 while (!this.isStopped()) {
                     try {
    -                    this.waitForRunning(0);
    +                    this.waitForRunning(1000);
    --- End diff --
    
    I also think `waitForRunning(0)` is too rigorous, but `waitForRunning(1000)` is adventurous while the `GroupCommitService` may miss some notify signals.
    
    How about set a smaller wait time, like 10ms? what's your opinion ? @qinliujie 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq pull request #31: [ROCKETMQ-33] CPU Occupy 100%

Posted by zhouxinyu <gi...@git.apache.org>.
Github user zhouxinyu commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/31#discussion_r95059198
  
    --- Diff: store/src/main/java/org/apache/rocketmq/store/CommitLog.java ---
    @@ -1045,7 +1045,7 @@ public void run() {
     
                 while (!this.isStopped()) {
                     try {
    -                    this.waitForRunning(0);
    +                    this.waitForRunning(1000);
    --- End diff --
    
    `GroupCommitService` will be used when broker is in `SYNC_FLUSH`, so the flushCommitLogService need always `doCommit` without a break.
    
    And this won't cause 100% CPU usage unless your server only has one cpu core.
    
    BTW, how about use `ASYNC_FLUSH` if you mind.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #31: [ROCKETMQ-34] CPU Occupy 100%

Posted by qinliujie <gi...@git.apache.org>.
Github user qinliujie commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/31
  
    Sorry,I wrote the wrong issue number,it shoud be [ROCKETMQ-33] CPU Occupy 100% 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #31: [ROCKETMQ-33] CPU Occupy 100%

Posted by zhouxinyu <gi...@git.apache.org>.
Github user zhouxinyu commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/31
  
    Hi, @qinliujie  This PR will be merged soon, but next time please send PR from branch ROCKETMQ-33 instead of master.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #31: [ROCKETMQ-33] CPU Occupy 100%

Posted by vintagewang <gi...@git.apache.org>.
Github user vintagewang commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/31
  
    review ok.  


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #31: [ROCKETMQ-33] CPU Occupy 100%

Posted by qinliujie <gi...@git.apache.org>.
Github user qinliujie commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/31
  
    @zhouxinyu OK.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #31: [ROCKETMQ-33] CPU Occupy 100%

Posted by Ah39 <gi...@git.apache.org>.
Github user Ah39 commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/31
  
    waitForRunning(0) is call wait(0). wait(0)  is wait forever util somenoe notify the Thread 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #31: [ROCKETMQ-33] CPU Occupy 100%

Posted by zhouxinyu <gi...@git.apache.org>.
Github user zhouxinyu commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/31
  
    Thanks @qinliujie, please @vongosling @stevenschew help review.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #31: [ROCKETMQ-33] CPU Occupy 100%

Posted by qinliujie <gi...@git.apache.org>.
Github user qinliujie commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/31
  
    When I use ASYNC_MASTER,there was the same problem,Because  HAService also has `this.waitForRunning(0)`,whether SYNC_MASTER or not.
    
    When you said that the `GroupCommitService` may miss some notify signals,I think it's right.So I think wait time to be 10ms is acceptable. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq pull request #31: [ROCKETMQ-33] CPU Occupy 100%

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-rocketmq/pull/31


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rocketmq issue #31: [ROCKETMQ-33] CPU Occupy 100%

Posted by qinliujie <gi...@git.apache.org>.
Github user qinliujie commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/31
  
    old version use the Object wait() method,but it had changed to countdown latch in new version,please notice that @Jaskey 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---