Tomasz Nykiel– University of Toronto Michalis Potamias– Boston University Chaitanya Mishra - Facebook George Kollios - Boston University Nick Koudas -

Slides:



Advertisements
Similar presentations
Starfish: A Self-tuning System for Big Data Analytics.
Advertisements

MAP REDUCE PROGRAMMING Dr G Sudha Sadasivam. Map - reduce sort/merge based distributed processing Best for batch- oriented processing Sort/merge is primitive.
LIBRA: Lightweight Data Skew Mitigation in MapReduce
MRShare: Sharing Across Multiple Queries in MapReduce By Tomasz Nykiel (University of Toronto) Michalis Potamias (Boston University) Chaitanya Mishra (University.
© Hortonworks Inc Daniel Dai Thejas Nair Page 1 Making Pig Fly Optimizing Data Processing on Hadoop.
Parallel Computing MapReduce Examples Parallel Efficiency Assignment
Chapter 5 Fundamental Algorithm Design Techniques.
Cloud Computing Resource provisioning Keke Chen. Outline  For Web applications statistical Learning and automatic control for datacenters  For data.
Online Social Networks and Media. Graph partitioning The general problem – Input: a graph G=(V,E) edge (u,v) denotes similarity between u and v weighted.
Merge Sort 4/15/2017 6:09 PM The Greedy Method The Greedy Method.
Meeting Service Level Objectives of Pig Programs Zhuoyao Zhang, Ludmila Cherkasova, Abhishek Verma, Boon Thau Loo University of Pennsylvania Hewlett-Packard.
The number of edge-disjoint transitive triples in a tournament.
Query Evaluation. An SQL query and its RA equiv. Employees (sin INT, ename VARCHAR(20), rating INT, age REAL) Maintenances (sin INT, planeId INT, day.
Lecture 24: Query Execution Monday, November 20, 2000.
FALL 2006CENG 351 Data Management and File Structures1 External Sorting.
Using Secondary Storage Effectively In most studies of algorithms, one assumes the "RAM model“: –The data is in main memory, –Access to any item of data.
Copyright © Cengage Learning. All rights reserved. CHAPTER 11 ANALYSIS OF ALGORITHM EFFICIENCY ANALYSIS OF ALGORITHM EFFICIENCY.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
1 CSE 326: Data Structures: Sorting Lecture 17: Wednesday, Feb 19, 2003.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
Improved results for a memory allocation problem Rob van Stee University of Karlsruhe Germany Leah Epstein University of Haifa Israel WADS 2007 WAOA 2007.
Advanced Topics: MapReduce ECE 454 Computer Systems Programming Topics: Reductions Implemented in Distributed Frameworks Distributed Key-Value Stores Hadoop.
Hadoop Ida Mele. Parallel programming Parallel programming is used to improve performance and efficiency In a parallel program, the processing is broken.
Multiplicative Weights Algorithms CompSci Instructor: Ashwin Machanavajjhala 1Lecture 13 : Fall 12.
Lecture 2 We have given O(n 3 ), O(n 2 ), O(nlogn) algorithms for the max sub-range problem. This time, a linear time algorithm! The idea is as follows:
Lecture 2 Computational Complexity
Mehdi Kargar Aijun An York University, Toronto, Canada Keyword Search in Graphs: Finding r-cliques.
Approximation schemes Bin packing problem. Bin Packing problem Given n items with sizes a 1,…,a n  (0,1]. Find a packing in unit-sized bins that minimizes.
MapReduce: Simplified Data Processing on Large Clusters Jeffrey Dean and Sanjay Ghemawat.
Introduction to Hadoop and HDFS
CPS216: Advanced Database Systems (Data-intensive Computing Systems) Introduction to MapReduce and Hadoop Shivnath Babu.
Order Statistics. Order statistics Given an input of n values and an integer i, we wish to find the i’th largest value. There are i-1 elements smaller.
Page 1 Online Aggregation for Large MapReduce Jobs Niketan Pansare, Vinayak Borkar, Chris Jermaine, Tyson Condie VLDB 2011 IDS Fall Seminar
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
Copyright © Curt Hill Query Evaluation Translating a query into action.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
BALANCED DATA LAYOUT IN HADOOP CPS 216 Kyungmin (Jason) Lee Ke (Jessie) Xu Weiping Zhang.
MC 2 : Map Concurrency Characterization for MapReduce on the Cloud Mohammad Hammoud and Majd Sakr 1.
Advanced Analytics on Hadoop Spring 2014 WPI, Mohamed Eltabakh 1.
Computing Scientometrics in Large-Scale Academic Search Engines with MapReduce Leonidas Akritidis Panayiotis Bozanis Department of Computer & Communication.
Multi pass algorithms. Nested-Loop joins Tuple-Based Nested-loop Join Algorithm: FOR each tuple s in S DO FOR each tuple r in R DO IF r and s join to.
UNIT 5.  The related activities of sorting, searching and merging are central to many computer applications.  Sorting and merging provide us with a.
CS4432: Database Systems II Query Processing- Part 2.
IBM Research ® © 2007 IBM Corporation Introduction to Map-Reduce and Join Processing.
ApproxHadoop Bringing Approximations to MapReduce Frameworks
Spring 2008The Greedy Method1. Spring 2008The Greedy Method2 Outline and Reading The Greedy Method Technique (§5.1) Fractional Knapsack Problem (§5.1.1)
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
Clustering Data Streams A presentation by George Toderici.
1 Algorithms Searching and Sorting Algorithm Efficiency.
”Map-Reduce-Merge: Simplified Relational Data Processing on Large Clusters” Published In SIGMOD '07 By Yahoo! Senthil Nathan N IIT Bombay.
Merge Sort 7/29/ :21 PM The Greedy Method The Greedy Method.
The Greedy Method and Text Compression
Introduction to MapReduce and Hadoop
MapReduce Computing Paradigm Basics Fall 2013 Elke A. Rundensteiner
Chapter 15 QUERY EXECUTION.
Database Applications (15-415) Hadoop Lecture 26, April 19, 2016
Database Management Systems (CS 564)
湖南大学-信息科学与工程学院-计算机与科学系
February 26th – Map/Reduce
Cse 344 May 4th – Map/Reduce.
Merge Sort 11/28/2018 2:18 AM The Greedy Method The Greedy Method.
The Greedy Method Spring 2007 The Greedy Method Merge Sort
Merge Sort 11/28/2018 2:21 AM The Greedy Method The Greedy Method.
Merge Sort 11/28/2018 8:16 AM The Greedy Method The Greedy Method.
KMeans Clustering on Hadoop Fall 2013 Elke A. Rundensteiner
Merge Sort 1/17/2019 3:11 AM The Greedy Method The Greedy Method.
CENG 351 Data Management and File Structures
Discrete Mathematics 7th edition, 2009
Merge Sort 5/2/2019 7:53 PM The Greedy Method The Greedy Method.
Lecture 20: Query Execution
Presentation transcript:

Tomasz Nykiel– University of Toronto Michalis Potamias– Boston University Chaitanya Mishra - Facebook George Kollios - Boston University Nick Koudas - University of Toronto Article from VLDB, september 2010 Lecture by Itay Abulafia Hebrew university 1

 Big data  Analytical, long processed queries Word count, relations  Cloud computing Amazon EC2 Computation = Money!! 2

 MapReduce  GreedySharing  Scan sharing  Sharing map output  ϒ sharing output 3

 The prevalent computational paradigm in the cloud  Very useful for large-scale data processing  - open source, large community  High level abstraction languages are rising 4

5

Grades AVG MajorAgeGenderName 81Math25FAbu Alice1 93Literature21MBrown Bob2 76CS24MCohen Carl3 87Business22FDoe Dee4 85CS27MEzra Erez5 89Law28FFlitch Fania6 Job 1: Students count by gender Job 2: Count students in Mt. Scopus Job 3: Count students with grade > 88 Job 4: Students names start with D 6

81…1 93…2 76…3 87…4 85…5 89…6 81…1 93…2 76…3 87…4 85…5 89…6 81…1 93…2 76…3 87…4 85…5 89…6 81…1 93…2 76…3 87…4 85…5 89…6 Job 3: Job 1: 1g 1g 1f 1m 1m 1f 1m 1f Map Intermediate data reduce 3f 3m 2g output 7

suppose we have input table T(a,b,c) Select T.a, sum (b) from T where {filters} Map: (Ø,(T i.a,T i.b,T i.c))->{filters}->(T.a,list(T.b)) Reduce: (T.a, list(Tb))->sum(b) -> (T.a, sum(b)) 8

 File F  n MapReduce jobs J= {j 1 …j n }  Every job j has m map tasks and r reduce tasks  |M i | average map task output, |R i | average reduce input  |D i | average intermediate data, |D i |=|M i |∙m=|R i |∙r  Buffer size is B+1 T(J)=T read (J)+T sort (J) + T tr (J)(+T wright ) 9

T(J) = T read (J) + T sort (J) + T tr (J)  C r - cost of reading/writing remotely  C t - cost of tranfering data from one node to another  C l - cost of reading/writing localy T read (J) = C r ∙ n ∙|F| T tr (J) = C tr ∙ |D i | T sort (J) = 10 will be called p i later

map phase T map (J)= reduce phase T red (J) = Sum T sort (J) = 11

 Dataset of 10GB  random grep-wordcount queries with output ratio 0.35  Using Hadoop over a cluster of 10 machines  Measured run time (in seconds) and derived values for system params 12

New datasets of various sizes between 10 and 50 GB New sets of queries with output ratio of 0.7 Run on a cluster of 10 machines Measured run time (in seconds) Used the cost model we just saw – T(J) = T read (J) + T sort (J) + T tr (J) to estimate run time predictions 13

 MapReduce  GreedySharing  Scan sharing  Sharing map output  ϒ sharing output 14

81Math25FAbu Alice1 job 1: reading input, asking: male or female? 81Math25FAbu Alice1 job 2: reading input, asking: is course in Mt. Scopus? 81Math25FAbu Alice1 job 1: reading input, asking: grades over 88? 81Math25FAbu Alice1 job 1: reading input, asking: does name start with D? 15

why not merge all jobs to one big meta job and have all the map functions share the input? 16

Grades AVG MajorAgeGenderName 81Math25FAbu Alice1 93Literature21MBrown Bob2 76CS24MCohen Carl3 87Business22FDoe Dee4 85CS27MEzra Erez5 89Law28FFlitch Fania6 Job 1: Students count by gender Job 2: Count students in Mt. Scopus Job 3: Count students with grade > 88 Job 4: Students names start with D 17

Grades AVGMajorAgeGenderName 81Math25FAbu Alice1 93Literature21MBrown Bob2 76CS24MCohen Carl3 87Business22FDoe Dee4 85CS27MEzra Erez5 89Law28FFlitch Fania6 Map 1Map 2Map 3Map 4Map 6Map 5 1f 1f 1f 1m 1m 1m 93ms 89ms 87ms 1g 1g1n 18

Grades AVGMajorAgeGenderName 81Math25FAbu Alice1 93Literature21MBrown Bob2 76CS24MCohen Carl3 87Business22FDoe Dee4 85CS27MEzra Erez5 89Law28FFlitch Fania6 Map 1Map 2Map 3Map 4Map 6Map 5 Reduce j1,1 Reduce j1,2 Reduce j2 Reduce j4 Reduce j3 1f 1f 1f 1m 1m 1m 93ms 89ms 87ms 1g 1g1n 19

 let G be one job containing all n jobs  |X G |=|X m |∙ m = |X r |· r  T(J G )= T read (J G ) + T sort (J G ) + T tr (J G )  T read (J G ) = C r · |F|  T tr (J G ) = C t · |X G |  T sort (J G ) = 20

81Math25FAbu Alice1 Male or female?Is course in Mt. Scopus? Grades over 88? Does name start with D? 21

 define p i =  define p G =  let J j = j i : max {|D i |} (n<B) Lower bound Upper bound 22

after grouping all n jobs, the number of sorting passes in p G is either equal to Pj or increased by 1. we say p G = p j +δ G (δ G = {0,1}) in some cases, where P i < P G, the benefits of saving scans may be cancelled by the added costs during sorting 23

3 random series 16 grep-wordcount jobs Constraint on the average output ratio Maximum output ratio is 1.35 Time (no grouping) normalized to 1 24

 MapReduce  GreedySharing  Scan sharing  Sharing map output  ϒ sharing output 25

given n jobs on the same file, we want to group jobs in such way that the execution time is minimal. 26

Let d i be the output ratio of job i: Let f be the savings of sharing the input: saves on readings waste on sorting p i sorting passes i p j sorting passes j Define gain (i,j) = 27

Given a set of jobs J = {j 1 …j n }, group the jobs into S non-overlapping groups G 1 …G s such that the overall sum of ScanShared(G i ), is maximized. This problem is NP-Hard problem (can be reduced from Set-Partition) 28

We approximate the sorting cost of each job, and sort the jobs by their sorting size Now our problem is searching the optimal split of a sorted list into groups using our cost model 29

Assume we have n jobs sorted by d 1 ≤ d n (they are also sorted by p i) GroupSavings(t,u)= GS(t,t)=0 We look for max GS() on our set of jobs 30

Wrong! 31

proof: Assume the optimal solution contain the group G s ={t…u-1,u+1..v}. if {u} is a singleton group:  If gain (u,v) ≥ 0, then gain ({G s }U{u}) is better than gain ({G s }) + gain ({u})  if gain (u,v) < 0 then gain (u-1,v) < 0 and it would be optimal to have u-1 as a singleton as well 32

if {u} is not a singleton group:  {u} in G s+1 = {u,w…z} where z>v: › if p v +δ v = p z +δ z then G s and G s+1 can be merged with no cost, and we save a scan. › if p v + δ v gaing (u,z), putting {u} in G s will have higher savings.  {u} in G s-1 = {w…x,u,z} where z<v: gain (u,z) > gain (u,v), therefore gain (u-1,z) > gain (u-1,v) 33

Consider the optimal arrangement j 1 …j l, in this arrangement the last group that ends with j l start with some j i, the preceding groups contain j 1 …j i-1 in the optimal arrangement. c(l)=max{c(i-1)+GS(i,l)} 34

we build a “source” table, on each cell we want to: 1)compute GS(i,l) for 1 ≤ i ≤ l 2)compute best split(l) for 1 ≤ i ≤ l 3) return c(l) and source O(n 2 ) 35

G1 G2 G4 G3 why not run the algorithm again? 36

37

In each iteration we have two cases:  The iteration return some new groups, so we remove them and run the SplitJob again  The iteration return only singletons, so we can remove the smallest job since it doesn’t give any savings when merged to other jobs.  O(N 3 ) 38

We only save scanning time Savings are strongly depend on intermediate data The more intermediate data, more and smaller groups 39

 MapReduce  GreedySharing  sharing scans  Sharing map output  ϒ sharing output 40

Theorm 2: Given a set of jobs J ={j 1 … j n } for any two jobs j k j l if the map output of j k is entirely contained in the map output of j l, then there is some optimal groping that contains a group with both j k and j l. 41

example: Give input of T(a,b,c), we have two jobs: J k filter T.a > 3 J l filter T,a > 2 we assume that such constraints have been identified 42

Grades AVGMajorAgeGenderName 81Math25FAbu Alice1 93Literature21MBrown Bob2 76CS24MCohen Carl3 87Business22FDoe Dee4 85CS27MEzra Erez5 89Law28FFlitch Fania6 Map 1Map 2Map 3Map 4Map 6Map 5 Job 1: Students count by gender Job 2: Count students in Mt. Scopus Job 3: Count students with grade > 88 Job 4: Students names start with D 43

Grades AVGMajorAgeGenderName 81Math25FAbu Alice1 93Literature21MBrown Bob2 76CS24MCohen Carl3 87Business22FDoe Dee4 85CS27MEzra Erez5 89Law28FFlitch Fania6 Map 1Map 2Map 3Map 4Map 6Map 5 1fj11mj1, j2, j3 1mj1 1fj1, j2, DDDj4 1mj1 1fj1, j2 Reduce j1,1 Reduce j1,2 Reduce j2 Reduce j4 Reduce j3 44

Same series of jobs, same groupings Save time of copy and transfer data Greater redundancy – more savings This is NOT the optimal grouping 45

 MapReduce  GreedySharing  sharing scans  Sharing map output  ϒ sharing output 46

let ϒ (0 ≤ ϒ ≤ 1) be a global parameter, which quantifies the amount of sharing among all jobs. for a group G with n merged jobs, where J j is the constituent job, ϒ satisfies: X G = d j + ϒ what happens when ϒ = 0? what happens when ϒ = 1? 47

recall gain (i,j) = f- 2di(Pj + δj – Pi), we now define gain (i,j) = same problem with a different gain function. 48

same groups when ϒ is 1, the results are at least as good as MultySplitJobs if ϒ is too optimistic, we enforce aggressive merging, degrading performance. good ϒ can be learned (previous runs, sampling) 49

 MapReduce  GreedySharing  sharing scans  Sharing map output  ϒ sharing output 50

 this paper described MRShare – automatic work sharing across multiple MapReduce jobs  With specific sharing opportunities we managed to save significant execution time from ~10% on sharing scans, up to 75% on sharing intermediate data on specific cases 51

 This work used 8000 machine hours on Amazon EC2, with a cost of 800$  Saving 20% in the execution time translate to 160$ 52

 How to define a good sharing opportunity? a good ϒ?  What happen when we share map functions between jobs  what happen when we operate on multiple inputs? (joins) 53

Thank you! 54