Title: Scheduling Shared Scans of Large Data Files
1Scheduling Shared Scans of Large Data Files
- Parag Agrawal, Daniel Kifer, Christopher Olston
Stanford University
Yahoo! Research
2Shared Scans
- Scans
- DBMS access method
- MapReduce, Hadoop, etc
- Hadoop at Yahoo!
- Few popular datasets
- Like the web crawl
- Many users and queries
- Shared scans (Previous Work)
- Multiple queries use the same scan
3Scheduling Shared Scans
1
4
looks at queues and anticipates arrivals
7
Scheduler
2
3
5
8
9
10
6
Idle
not popular
4Scheduling Objective
- Keep wait times small
- User-centric metric
- Perceived Wait Time (PWT)
- (Finish time arrival time) standalone
execution time - Time in queue batch execution overhead
- Overall
- Maximum vs. Average
- Hybrid
- Trade-off
- Parametera
-
5Query Family
- Group of shareable queries
- Eg. scan same file
- Shared cost S
- Eg. IO cost
- Non-shared costs
- N1, N2, and N3
- Eg. CPU cost
- Standalone execution cost
- SN1, SN2, SN3
- Batch execution cost
- SN1N2N3
- Arrival rate ?
- Captures popularity
- Single file queries
- Most Hadoop queries
- Joins are future work
6Practical Considerations
- Scheduler should be lightweight
- Priority based
- Limited information
- Shared cost S estimated using file size
- Arrival rate? estimated as jobs arrive
- Non-shared cost N hard to estimate
- Typically small compared to S since IO-bound
- Dropped terms
- Analytically and experimentally justified
7Rest of the Talk
- Average perceived wait time (PWT)
- Shortest Job First (SJF)
- Resource Allocation Model
- Wait Aware Model
- Maximum PWT
- Hybrid PWT
- Experiments
8Running Example
- Two query families
- Family F(requent and small)
- S 1
- ? ß
- Family L(arge and infrequent)
- S ß
- ? 1
- N ltlt S (take N 0)
- ß gt 1
- Average perceived wait time (PWT)
9Running Example Analysis
- Two effects
- L frequently scanned wait times of F dominate
- L infrequently scanned wait times of L dominate
- Optimal schedule (computed analytically)
- L every ß1.5 time units
- Average perceived wait time (PWT)
- O(ß0.5)
10Shortest Job First (SJF)
- Often used for response time metrics
- Modified for batch execution
- Job length batch time required / batch size
- Schedule
- L every ß2 time units
- Average perceived wait time (PWT)
- O(ß) vs. O(ß0.5) (optimal)
11Shortest Job First(SJF) Analyzed
- SJF policy can look arbitrarily bad
- Large ß
- Executes L too infrequently
- Wait times for L dominate
- ? Doesnt anticipate arrivals
- Ignores arrival rates
- ? Considers time spent waiting for others
- Small jobs first
12Resource Allocation Model
- Continuous fractional arrival of queries
- Dedicated executor for every query family
- Total work constrained F/PF L/PL 1
- Minimize average wait time PF.?F.(PF - F)
PL.?L.(PL - L) - Resource allocation problem
- Solved using Lagrange multipliers
13Resource Allocation Model Result
- Batch size B
- Invariant
- B2/?. S is constant across query families
- Translate to scheduling policy
- Use this as priority
- Running Example
- Schedule
- Round robin
- Average perceived wait time (PWT)
- O(ß) vs. O(ß0.5) (optimal)
14Resource Allocation Model Analyzed
- Relaxation policy can look arbitrarily bad
- Large ß
- Executes L too frequently
- Wait times for F dominate
- ? Doesnt consider time spent waiting for others
- Dedicated executors
- ? Anticipates arrivals
- Resource allocation
15Wait Aware Model
- Single executor
- New way to count wait times
- Priority B2/?. S - S .S?
- Optimal for running example (O(ß0.5))
- ? Anticipates arrivals
- ? Considers time spent waiting for others
In paper
Resource Allocation
Shortest Job First
16Rest of the Talk
- Average perceived wait time
- Shortest Job First (SJF)
- Resource Allocation Model
- Wait Aware Model
- Maximum First In First Out (FIFO)
- Hybrid Priority expression
- Experiments
In paper
17Experiments
- Compare scheduling policies
- Sensitivity to non-shared costs, estimators
- Bursty workloads
- Setup
- Simulations
- Synthetic workloads
- Mimic Hadoop workloads at Yahoo!
18Average PWT
FIFO Wait Aware Hybrid (0.99) SJF
Average perceived wait time
Load (?increasing)
19Hybrid Policies
Average Maximum
Average perceived wait time
Maximum perceived wait time
Hybrid parameter a
20Maximum PWT
FIFO Wait Aware Hybrid (0.99) SJF
Maximum perceived wait time
Load (?increasing)
21Handling Bursty Workloads
FIFO Wait Aware Hybrid (0.99) SJF
Moving average of PWT
Time
22Conclusion
- Anticipating queries to
- schedule shared scans
- decreases wait times for users.
Thank You Parag Agrawal paraga_at_cs.stanford.edu