Issue Details (XML | Word | Printable)

Key: HADOOP-5884
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Vinod K V
Reporter: Hemanth Yamijala
Votes: 0
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

Capacity scheduler should account high memory jobs as using more capacity of the queue

Created: 21/May/09 04:30 PM   Updated: 08/Jul/09 04:40 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 0.20.1

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works HADOOP-5884-20090529.1.txt 2009-05-29 07:01 AM Vinod K V 45 kB
Text File Licensed for inclusion in ASF works HADOOP-5884-20090602.1.txt 2009-06-02 11:51 AM Vinod K V 64 kB
Text File Licensed for inclusion in ASF works HADOOP-5884-20090603.txt 2009-06-03 01:51 PM Vinod K V 69 kB
Text File Licensed for inclusion in ASF works HADOOP-5884-20090605-branch-20.txt 2009-06-05 04:15 AM Vinod K V 69 kB
Text File Licensed for inclusion in ASF works HADOOP-5884.patch 2009-06-04 01:55 PM Hemanth Yamijala 66 kB
Issue Links:
Blocker
Incorporates
 

Hadoop Flags: Reviewed
Release Note:
Fixes Capacity scheduler to account more capacity of a queue for a high memory job. Done by considering these jobs to
take more slots proportionally with respect to a slot's default memory size.
Resolution Date: 05/Jun/09 06:01 AM


 Description  « Hide
Currently, when a high memory job is scheduled by the capacity scheduler, each task scheduled counts only once in the capacity of the queue, though it may actually be preventing other jobs from using spare slots on that node because of its higher memory requirements. In order to be fair, the capacity scheduler should proportionally (with respect to default memory) account high memory jobs as using a larger capacity of the queue.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vinod K V made changes - 27/May/09 06:27 AM
Field Original Value New Value
Assignee Vinod K V [ vinodkv ]
Vinod K V added a comment - 29/May/09 07:01 AM
The proposal is to track capacities and user-limits by the number of slots occupied by the tasks of a job instead of the number of running tasks.

Attaching patch implementing this. This patch has to be applied over the latest patch for HADOOP-5932. This patch does the following:

  • Modifies all the calculations of capacities and user-limits to be based on the number of slots occupied by running tasks of a job.
  • Retains number of running tasks for displaying on the UI
  • Adds test-cases to verify the number of slots accounted for high memory jobs by modifying the corresponding tests.
  • Adds test-cases to verify the newly added "occupied slots" in the scheduling information
  • Adds missing @override tags, removes stale imports and stale occurrences of gc (guarenteed capacity)

Vinod K V made changes - 29/May/09 07:01 AM
Attachment HADOOP-5884-20090529.1.txt [ 12409348 ]
Vinod K V made changes - 29/May/09 07:01 AM
Link This issue is blocked by HADOOP-5932 [ HADOOP-5932 ]
Vinod K V made changes - 29/May/09 07:02 AM
Link This issue incorporates HADOOP-5934 [ HADOOP-5934 ]
Vinod K V added a comment - 29/May/09 07:02 AM
The above patch also incorporates minor modifications to test-cases as suggested in HADOOP-5934.

Hemanth Yamijala added a comment - 01/Jun/09 03:45 PM
Some comments:
  • TaskSchedulingInfo.toString() - displaying the actual value had some problem in terms of exactness and mismatch between cluster info and the state we kept. That's why we shifted to percentages. May be a good idea to retain the model. Same argument can be made for running tasks and numSlotsOccupiedByThisUser
  • "Occupied slots" seems too techie. Call it 'Used capacity' ? Likewise instead of '% of total slots occupied by all users', call it '% of used capacity' ?
  • TaskSchedulingMgr.isUserOverLimit() - we add 1 if we're using more than the queue capacity. It could be more than 1, depending on the task we are assigning (if it's part of high RAM job)
  • MapSchedulingMgr constructor: typo: schedulr - should be scheduler. Similar for Reduce...
  • Minor NIT: Use format instead of the complicated StringBuffer.append()... kind of code. Makes it really hard to find what's happening.
  • updateQSIObjects. The log statement is printing numMapSlotsForThisJob instead of numMapsRunningForThisJob.

Arun C Murthy added a comment - 01/Jun/09 09:39 PM
Can we also add the number of slots to the UI?

Arun C Murthy added a comment - 01/Jun/09 10:06 PM
Long term - we really should fix TestCapacityScheduler to not check strings and use relevant apis (even package-private ones).

Hemanth Yamijala added a comment - 02/Jun/09 06:07 AM
Some comments on test cases:
  • testClusterBlockingForLackOfMemory needs updates to validate the number of slots
  • I think we may need two additional tests:
    • We should have a test to check the change in sorting of queues done based on slots than running tasks. We could do this by submitting 2 jobs to 2 queues, 1 is normal and the other is high RAM. We can check that for every assignTasks call, if 1 task of the high RAM job is scheduled, two tasks of the normal job are (assuming 2 slots for a task of the high RAM Jobs).
    • We should have a check on user limits that a high RAM job hits it's user limits twice as fast as a normal job, again assuming 2 slots for a task of the high RAM job.

Vinod K V added a comment - 02/Jun/09 11:51 AM
Updated patch incorporating all the above review comments except one:
  • Removed running tasks information from the UI. As of now, we are trying to avoid absolute numbers because of possible inconsistency between scheduler's information and cluster status. And, specifying running tasks as a percentage of total cluster capacity doesn't make sense now with each task possibly occupying multiple slots. The correct fix is to print absolute numbers after removing any inconsisteny possible. Hence pushing this to another follow-up jira issue.

@Arun

Can we also add the number of slots to the UI?

I didn't get this. Do you mean number of slots per job being displayed in job-scheduling information? We are already displaying the number of slots used by a queue as percentage.

If you meant the first, I already considered this, but let it go for another jira. The job scheduling information is being displayed on the jobtracker ui first page and it looked ugly when it spanned multiple lines. I think it would be good if we can remove job scheduling information from the first page. But as that might trigger discussion, I've decided to leave it for now.

Long term - we really should fix TestCapacityScheduler to not check strings and use relevant apis (even package-private ones).

Agree, even I could realize the pain while modifying testcases, but decide to postpone it for another jira as it is slightly tricky.


Vinod K V made changes - 02/Jun/09 11:51 AM
Attachment HADOOP-5884-20090602.1.txt [ 12409659 ]
Arun C Murthy made changes - 03/Jun/09 12:53 AM
Link This issue blocks HADOOP-5964 [ HADOOP-5964 ]
Arun C Murthy added a comment - 03/Jun/09 08:02 AM
I'm just proposing we add #slots (along with already available #running_tasks) to both per-queue info and per-job info (jobdetails.jsp) so that it's clear to users that the queue isn't being under-served (since #running_tasks might be lesser than #slots_taken).

Vinod K V added a comment - 03/Jun/09 01:51 PM
Latest patch with Arun's comments incorporated, bringing back the absolute counts for running tasks, occupied capacities. Also added job scheduling information to the jobdetails.jsp page.

Vinod K V made changes - 03/Jun/09 01:51 PM
Attachment HADOOP-5884-20090603.txt [ 12409769 ]
Vinod K V made changes - 03/Jun/09 01:52 PM
Status Open [ 1 ] Patch Available [ 10002 ]
Vinod K V made changes - 04/Jun/09 05:09 AM
Link This issue blocks HADOOP-5090 [ HADOOP-5090 ]
Hemanth Yamijala added a comment - 04/Jun/09 01:55 PM
A slightly modified patch. Basically just makes the comments and debug statements in test cases match code. The list of changes made are the following:
  • Added a comment on the getOrderedQueues method.
  • In testUserLimitsForHighMemoryJobs - set max reduce slots set to 2G instead of 1, as we are submitting jobs with 2G reduces.
  • Same test, JobConf was being overwritten. I changed that.
  • Also, Debug statement not matching the submitted high RAM job. (were saying 0MB reduces) Changed that.
  • Also corrected debug statements in testQueueOrdering

Hemanth Yamijala made changes - 04/Jun/09 01:55 PM
Attachment HADOOP-5884.patch [ 12409882 ]
Hemanth Yamijala added a comment - 04/Jun/09 02:01 PM
Results of test-patch:

[exec] +1 overall.
[exec]
[exec] +1 @author. The patch does not contain any @author tags.
[exec]
[exec] +1 tests included. The patch appears to include 4 new or modified tests.
[exec]
[exec] +1 javadoc. The javadoc tool did not generate any warning messages.
[exec]
[exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings.
[exec]
[exec] +1 findbugs. The patch does not introduce any new Findbugs warnings.
[exec]
[exec] +1 Eclipse classpath. The patch retains Eclipse classpath integrity.
[exec]
[exec] +1 release audit. The applied patch does not increase the total number of release audit warnings.
[exec]

All capacity scheduler tests pass, except TestQueueCapacities which is being tracked elsewhere.


Hemanth Yamijala added a comment - 04/Jun/09 02:02 PM
Vinod, can you please upload a patch for Hadoop 0.20, so I can commit it to the 0.20 branch as well ? I will commit both together.

Vinod K V added a comment - 05/Jun/09 04:15 AM
Patch for branch-0.20

Vinod K V made changes - 05/Jun/09 04:15 AM
Attachment HADOOP-5884-20090605-branch-20.txt [ 12409928 ]
Repository Revision Date User Message
ASF #781916 Fri Jun 05 05:54:17 UTC 2009 yhemanth HADOOP-5884. Fixes accounting in capacity scheduler so that high RAM jobs take more slots. Contributed by Vinod Kumar Vavilapalli.
Files Changed
MODIFY /hadoop/core/trunk/src/webapps/job/jobdetails.jsp
MODIFY /hadoop/core/trunk/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java
MODIFY /hadoop/core/trunk/CHANGES.txt
MODIFY /hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java
MODIFY /hadoop/core/trunk/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacityTaskScheduler.java

Repository Revision Date User Message
ASF #781918 Fri Jun 05 05:59:19 UTC 2009 yhemanth HADOOP-5884. Fixes accounting in capacity scheduler so that high RAM jobs take more slots. Contributed by Vinod Kumar Vavilapalli.
Files Changed
MODIFY /hadoop/core/branches/branch-0.20/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java
MODIFY /hadoop/core/branches/branch-0.20/CHANGES.txt
MODIFY /hadoop/core/branches/branch-0.20/src/webapps/job/jobdetails.jsp
MODIFY /hadoop/core/branches/branch-0.20/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java
MODIFY /hadoop/core/branches/branch-0.20/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacityTaskScheduler.java

Hemanth Yamijala added a comment - 05/Jun/09 06:01 AM
I just committed this to trunk and branch 0.20. Thanks, Vinod !

Hemanth Yamijala made changes - 05/Jun/09 06:01 AM
Resolution Fixed [ 1 ]
Fix Version/s 0.20.1 [ 12313866 ]
Hadoop Flags [Reviewed]
Status Patch Available [ 10002 ] Resolved [ 5 ]
Hudson added a comment - 11/Jun/09 07:59 PM

Hemanth Yamijala made changes - 12/Jun/09 03:56 PM
Release Note Fixes Capacity scheduler to account more capacity of a queue for a high memory job. Done by considering these jobs to
take more slots proportionally with respect to a slot's default memory size.
Owen O'Malley made changes - 08/Jul/09 04:40 PM
Component/s contrib/capacity-sched [ 12312466 ]