Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-7037

Optimize data transfer with zero-copy approach for containerlogs REST API in NMWebServices

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.9.0, 3.0.0-beta1, 2.8.3
    • Component/s: nodemanager
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      Split this improvement from YARN-6259.
      It's useful to read container logs more efficiently. With zero-copy approach, data transfer pipeline (disk --> read buffer --> NM buffer --> socket buffer) can be optimized to pipeline(disk --> read buffer --> socket buffer) .
      In my local test, time cost of copying 256MB file with zero-copy can be reduced from 12 seconds to 2.5 seconds.

      1. YARN-7037.001.patch
        5 kB
        Tao Yang
      2. YARN-7037.branch-2.8.001.patch
        2 kB
        Tao Yang

        Activity

        Hide
        Tao Yang Tao Yang added a comment -

        Thanks Junping Du for review and commit !

        Show
        Tao Yang Tao Yang added a comment - Thanks Junping Du for review and commit !
        Hide
        hudson Hudson added a comment -

        ABORTED: Integrated in Jenkins build Hadoop-trunk-Commit #12264 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12264/)
        YARN-7037. Optimize data transfer with zero-copy approach for (junping_du: rev ad45d19998c1b0da25754d0016854046731fa623)

        • (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/LogToolUtils.java
        • (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebServices.java
        Show
        hudson Hudson added a comment - ABORTED: Integrated in Jenkins build Hadoop-trunk-Commit #12264 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12264/ ) YARN-7037 . Optimize data transfer with zero-copy approach for (junping_du: rev ad45d19998c1b0da25754d0016854046731fa623) (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/LogToolUtils.java (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebServices.java
        Hide
        djp Junping Du added a comment -

        I have commit patch to trunk, branch-2 and branch-2.8 - not 2.8.2 given only blocker/critical issues are accepted at this moment. Thanks Tao Yang for reporting the issue and delivering the fix!

        Show
        djp Junping Du added a comment - I have commit patch to trunk, branch-2 and branch-2.8 - not 2.8.2 given only blocker/critical issues are accepted at this moment. Thanks Tao Yang for reporting the issue and delivering the fix!
        Hide
        djp Junping Du added a comment -

        LogToolUtils#outputContainerLog was used for both local log which can be optimized by FileInputStream and aggregated log which can't because it's transferred by DataInputStream from remote.

        I see. That make sense to me.

        +1 on latest patch. Will commit it tomorrow if no further comments from others.

        Show
        djp Junping Du added a comment - LogToolUtils#outputContainerLog was used for both local log which can be optimized by FileInputStream and aggregated log which can't because it's transferred by DataInputStream from remote. I see. That make sense to me. +1 on latest patch. Will commit it tomorrow if no further comments from others.
        Hide
        Tao Yang Tao Yang added a comment -

        Thanks Junping Du for looking into the issue.
        I chose to add new method since this optimization can not cover all use cases, zero-copy is only fit for local read. LogToolUtils#outputContainerLog was used for both local log which can be optimized by FileInputStream and aggregated log which can't because it's transferred by DataInputStream from remote.

        Show
        Tao Yang Tao Yang added a comment - Thanks Junping Du for looking into the issue. I chose to add new method since this optimization can not cover all use cases, zero-copy is only fit for local read. LogToolUtils#outputContainerLog was used for both local log which can be optimized by FileInputStream and aggregated log which can't because it's transferred by DataInputStream from remote.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 15s Docker mode activated.
              Prechecks
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
              trunk Compile Tests
        0 mvndep 0m 10s Maven dependency ordering for branch
        +1 mvninstall 13m 22s trunk passed
        +1 compile 9m 47s trunk passed
        +1 checkstyle 0m 50s trunk passed
        +1 mvnsite 1m 7s trunk passed
        -1 findbugs 0m 48s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager in trunk has 1 extant Findbugs warnings.
        +1 javadoc 0m 58s trunk passed
              Patch Compile Tests
        0 mvndep 0m 10s Maven dependency ordering for patch
        +1 mvninstall 0m 55s the patch passed
        +1 compile 5m 54s the patch passed
        +1 javac 5m 54s the patch passed
        -0 checkstyle 0m 51s hadoop-yarn-project/hadoop-yarn: The patch generated 1 new + 8 unchanged - 0 fixed = 9 total (was 8)
        +1 mvnsite 1m 10s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 2m 11s the patch passed
        +1 javadoc 0m 56s the patch passed
              Other Tests
        +1 unit 2m 29s hadoop-yarn-common in the patch passed.
        +1 unit 13m 44s hadoop-yarn-server-nodemanager in the patch passed.
        +1 asflicense 0m 24s The patch does not generate ASF License warnings.
        64m 59s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:14b5c93
        JIRA Issue YARN-7037
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12883301/YARN-7037.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 9d4e9588a6f4 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 7e6463d
        Default Java 1.8.0_144
        findbugs v3.1.0-RC1
        findbugs https://builds.apache.org/job/PreCommit-YARN-Build/17098/artifact/patchprocess/branch-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-nodemanager-warnings.html
        checkstyle https://builds.apache.org/job/PreCommit-YARN-Build/17098/artifact/patchprocess/diff-checkstyle-hadoop-yarn-project_hadoop-yarn.txt
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/17098/testReport/
        modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager U: hadoop-yarn-project/hadoop-yarn
        Console output https://builds.apache.org/job/PreCommit-YARN-Build/17098/console
        Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 15s Docker mode activated.       Prechecks +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.       trunk Compile Tests 0 mvndep 0m 10s Maven dependency ordering for branch +1 mvninstall 13m 22s trunk passed +1 compile 9m 47s trunk passed +1 checkstyle 0m 50s trunk passed +1 mvnsite 1m 7s trunk passed -1 findbugs 0m 48s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager in trunk has 1 extant Findbugs warnings. +1 javadoc 0m 58s trunk passed       Patch Compile Tests 0 mvndep 0m 10s Maven dependency ordering for patch +1 mvninstall 0m 55s the patch passed +1 compile 5m 54s the patch passed +1 javac 5m 54s the patch passed -0 checkstyle 0m 51s hadoop-yarn-project/hadoop-yarn: The patch generated 1 new + 8 unchanged - 0 fixed = 9 total (was 8) +1 mvnsite 1m 10s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 2m 11s the patch passed +1 javadoc 0m 56s the patch passed       Other Tests +1 unit 2m 29s hadoop-yarn-common in the patch passed. +1 unit 13m 44s hadoop-yarn-server-nodemanager in the patch passed. +1 asflicense 0m 24s The patch does not generate ASF License warnings. 64m 59s Subsystem Report/Notes Docker Image:yetus/hadoop:14b5c93 JIRA Issue YARN-7037 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12883301/YARN-7037.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 9d4e9588a6f4 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 7e6463d Default Java 1.8.0_144 findbugs v3.1.0-RC1 findbugs https://builds.apache.org/job/PreCommit-YARN-Build/17098/artifact/patchprocess/branch-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-nodemanager-warnings.html checkstyle https://builds.apache.org/job/PreCommit-YARN-Build/17098/artifact/patchprocess/diff-checkstyle-hadoop-yarn-project_hadoop-yarn.txt Test Results https://builds.apache.org/job/PreCommit-YARN-Build/17098/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager U: hadoop-yarn-project/hadoop-yarn Console output https://builds.apache.org/job/PreCommit-YARN-Build/17098/console Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        djp Junping Du added a comment -

        Thanks Tao Yang for delivering the patch. The approach (bypass unnecessary buffer) here make sense to me.
        For trunk branch patch, instead of adding a new method - outputContainerLogThroughZeroCopy, may be we should replace original method - outputContainerLog directly? So that other callers like outputAggregatedContainerLog() can benefit from the performance improvement here.

        Show
        djp Junping Du added a comment - Thanks Tao Yang for delivering the patch. The approach (bypass unnecessary buffer) here make sense to me. For trunk branch patch, instead of adding a new method - outputContainerLogThroughZeroCopy , may be we should replace original method - outputContainerLog directly? So that other callers like outputAggregatedContainerLog() can benefit from the performance improvement here.
        Hide
        Tao Yang Tao Yang added a comment -

        Upload v1 patch for trunk and update v1 patch for branch-2.8(There is no need to close i/o channel).

        Show
        Tao Yang Tao Yang added a comment - Upload v1 patch for trunk and update v1 patch for branch-2.8(There is no need to close i/o channel).
        Hide
        Tao Yang Tao Yang added a comment -

        Upload v1 patch for review.

        Show
        Tao Yang Tao Yang added a comment - Upload v1 patch for review.

          People

          • Assignee:
            Tao Yang Tao Yang
            Reporter:
            Tao Yang Tao Yang
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development