Giraph
  1. Giraph
  2. GIRAPH-307

InputSplit list can be long with many workers (and locality info) and should not be re-created every time a worker calls reserveInputSplit()

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.0.0
    • Component/s: bsp, graph
    • Labels:
      None

      Description

      While instrumenting the INPUT_SUPERSTEP and watching various runs, I see the input split list generated every time a worker calls reserveInputSplit is, for all intents and purposes, immutable per job. Therefore, we can save a fair amount of memory by not re-creating the list and re-querying ZooKeeper on each pass to claim another split. Only the reserved and finished children lists are ever mutated during the input phase of the job.

      1. GIRAPH-307-1.patch
        6 kB
        Eli Reisman
      2. GIRAPH-307-2.patch
        20 kB
        Eli Reisman
      3. GIRAPH-307-3.patch
        19 kB
        Eli Reisman

        Activity

        Hide
        Eli Reisman added a comment -

        This also attempts to re-use a single LocalityInfoSorter by making it the repository for the input split list until all splits have been read and the worker returns "null" from reserveInputSplit()

        passes mvn verify, will test on cluster ASAP and report back results.

        Show
        Eli Reisman added a comment - This also attempts to re-use a single LocalityInfoSorter by making it the repository for the input split list until all splits have been read and the worker returns "null" from reserveInputSplit() passes mvn verify, will test on cluster ASAP and report back results.
        Hide
        Eli Reisman added a comment -

        going to rebase this now that 301 & 318 are in, will post patch ASAP.

        Show
        Eli Reisman added a comment - going to rebase this now that 301 & 318 are in, will post patch ASAP.
        Hide
        Eli Reisman added a comment -

        Rebased this patch to be up to date with trunk as of Sept 17th. Since this patch also gives full responsibility to the LocalityInfoSorter for loading, storing, and iterating on the InputSplit path list, I changed its name to reflect its new level of responsibility and make the object's lifecycle more obvious in the code.

        Works, passes mvn verify, etc. should be ready for review.

        Show
        Eli Reisman added a comment - Rebased this patch to be up to date with trunk as of Sept 17th. Since this patch also gives full responsibility to the LocalityInfoSorter for loading, storing, and iterating on the InputSplit path list, I changed its name to reflect its new level of responsibility and make the object's lifecycle more obvious in the code. Works, passes mvn verify, etc. should be ready for review.
        Hide
        Maja Kabiljo added a comment -

        Looks good to me. Just one comment, can you please change the name of the test to reflect the class name change?
        Did you see any speed improvement because of less zookeeper reads?

        Show
        Maja Kabiljo added a comment - Looks good to me. Just one comment, can you please change the name of the test to reflect the class name change? Did you see any speed improvement because of less zookeeper reads?
        Hide
        Eli Reisman added a comment -

        Thanks again Maja, I rebased this and fixed the test name. It passed mvn verify again now.

        It should reduce ZK traffic during input superstep but in the brief testing I did it did not trim much time off input superstep. Its just a small fix I think. If I recall it prevents the repeated calls to ZK and the rebuild of the path list for every iteration on the list by all workers when the list itself never changes.

        Thanks again for the review!

        Show
        Eli Reisman added a comment - Thanks again Maja, I rebased this and fixed the test name. It passed mvn verify again now. It should reduce ZK traffic during input superstep but in the brief testing I did it did not trim much time off input superstep. Its just a small fix I think. If I recall it prevents the repeated calls to ZK and the rebuild of the path list for every iteration on the list by all workers when the list itself never changes. Thanks again for the review!
        Hide
        Maja Kabiljo added a comment -

        I see, reading this list is fast comparing to other things happening at that time. But still if we don't need to read it multiple times we shouldn't.

        Thanks, Eli, +1. Unless somebody has an objection, I'll commit this tonight.

        Show
        Maja Kabiljo added a comment - I see, reading this list is fast comparing to other things happening at that time. But still if we don't need to read it multiple times we shouldn't. Thanks, Eli, +1. Unless somebody has an objection, I'll commit this tonight.
        Hide
        Maja Kabiljo added a comment -

        If I see correctly the build failed for some strange reason which have happened before. What do we do in this case?

        Show
        Maja Kabiljo added a comment - If I see correctly the build failed for some strange reason which have happened before. What do we do in this case?
        Hide
        Avery Ching added a comment -

        In this case, it was a problem on the Hudson side.

        https://builds.apache.org/job/Giraph-trunk-Commit/228/console

        So log in to hudson and run it again =).

        Show
        Avery Ching added a comment - In this case, it was a problem on the Hudson side. https://builds.apache.org/job/Giraph-trunk-Commit/228/console So log in to hudson and run it again =).
        Hide
        Avery Ching added a comment -

        I just restarted it. https://builds.apache.org/job/Giraph-trunk-Commit/229/, let's see how it does this time.

        Show
        Avery Ching added a comment - I just restarted it. https://builds.apache.org/job/Giraph-trunk-Commit/229/ , let's see how it does this time.
        Hide
        Avery Ching added a comment -
        Show
        Avery Ching added a comment - This one passed. https://builds.apache.org/job/Giraph-trunk-Commit/229/

          People

          • Assignee:
            Eli Reisman
            Reporter:
            Eli Reisman
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development