You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Riguz Lee (Jira)" <ji...@apache.org> on 2022/07/12 11:25:00 UTC

[jira] [Comment Edited] (RATIS-1622) High cpu usage of LogAppenderDaemon

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

Riguz Lee edited comment on RATIS-1622 at 7/12/22 11:24 AM:
------------------------------------------------------------

Hi [~szetszwo] , 

In GrpcLogAppender, 
{code:java}
public long getWaitTimeMs() {
  if (haveTooManyPendingRequests()) {
    return getHeartbeatWaitTimeMs(); // Should wait for a short time
  } else if (shouldSendAppendEntries()) {
    return 0L;
  }
  return Math.min(10L, getHeartbeatWaitTimeMs());
} {code}
it could return 0L if the follower's commit index is behind, however if the follower is down, then it will keep looping, right? Here's a screenshot using arthas, which might be a evidence of that, but it might also be incorrect since I got different results each time.

!image-2022-07-12-19-20-06-014.png|width=438,height=191!


was (Author: JIRAUSER292654):
Hi [~szetszwo] , 

In GrpcLogAppender, 
{code:java}
public long getWaitTimeMs() {
  if (haveTooManyPendingRequests()) {
    return getHeartbeatWaitTimeMs(); // Should wait for a short time
  } else if (shouldSendAppendEntries()) {
    return 0L;
  }
  return Math.min(10L, getHeartbeatWaitTimeMs());
} {code}
it's could return 0L if the follower's commit index is behind, however if the follower is down, then it will keep looping, right? Here's a screenshot using arthas, which might be a evidence of that, but it might also be incorrect since I got different results each time.

!image-2022-07-12-19-20-06-014.png|width=438,height=191!

> High cpu usage of LogAppenderDaemon
> -----------------------------------
>
>                 Key: RATIS-1622
>                 URL: https://issues.apache.org/jira/browse/RATIS-1622
>             Project: Ratis
>          Issue Type: Improvement
>          Components: server
>            Reporter: Tsz-wo Sze
>            Assignee: Riguz Lee
>            Priority: Major
>         Attachments: image-2022-07-12-15-39-40-948.png, image-2022-07-12-15-40-29-685.png, image-2022-07-12-15-50-40-036.png, image-2022-07-12-19-20-06-014.png
>
>
> As reported by Riguz Lee in  https://lists.apache.org/thread/p5hq3nr1zqpkgd3fr0vyx9j5d2lx6gf9 , LogAppenderDaemon has a high cpu usage.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)