[ https://issues.apache.org/jira/browse/HDFS-11907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16031765#comment-16031765 ]
Chen Liang edited comment on HDFS-11907 at 5/31/17 7:13 PM: ------------------------------------------------------------ Post v001 patch to only call {{availableSpace = df.getAvailable()}} to update the value at most every 5 seconds. was (Author: vagarychen): Post v001 patch to only update call {{availableSpace = df.getAvailable()}} at most every 5 seconds. > NameNodeResourceChecker should avoid calling df.getAvailable too frequently > --------------------------------------------------------------------------- > > Key: HDFS-11907 > URL: https://issues.apache.org/jira/browse/HDFS-11907 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: Chen Liang > Assignee: Chen Liang > Attachments: HDFS-11907.001.patch > > > Currently, {{HealthMonitor#doHealthChecks}} invokes > {{NameNode#monitorHealth}} which ends up invoking > {{NameNodeResourceChecker#isResourceAvailable}}, at the frequency of once per > second by default. And NameNodeResourceChecker#isResourceAvailable invokes > {{df.getAvailable();}} every time it is called. > Since available space information should rarely be changing dramatically at > the pace of per second. A cached value should be sufficient. i.e. only try to > get the updated value when the cached value is too old. otherwise simply > return the cached value. This way df.getAvailable() gets invoked less. > Thanks [~arpitagarwal] for the offline discussion. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org