Embedded System Lab Map Reduce Simplified Data Processing
Embedded System Lab. Map. Reduce : Simplified Data Processing on Large Clusters Jeffrey Dean & Sanjay Ghemawat 2019. 11. 18 Presentation by Jeeweon, Lee leejeeweon 93@gmail. com
Reference Embedded System Lab. 2
Embedded System Lab. Contentt 1. Introduction 2. Programming Model 3. Implementation 4. Refinements 5. Performance Evaluation 6. Conclusion 3
1. Introduction Embedded System Lab. ● Map. Reduce runs on a large cluster of commodity machines and highly scalable ● user-specified map and reduce operations allows us to parallelize large computations easily ● use re-execution as the primary mechanism for fault tolerance 4
2. programming model ● Map. Reduce library expresses Map and Reduce function ● Map function produces a set of intermediate key/value pairs ● Map. Reduce library 관련된 모든 intermediate value 묶어 Reduce function에 전달 ● Reduce function 더 작은 set of value 형 Embedded System Lab. 5
2. programming model Embedded System Lab. Example 1 map(key=url, val=contents) For each word “w” in contents, emit (w, ” 1”) reduce(key=word, values=uniq_counts) Sum all “ 1” in values list Emit result “(word, sum)” Jin 1 Document 1: Jin is doing well Is Map Document 2: Jin is active Doing Well 1 1 1 Reduce 1 1 2 Jin 1 Is Active Doing Is 1 1 Well 1 6
3. Implementation Embedded System Lab. environment ● Dual-processor x 86 processors 2 -4 GB of memory per machine ● Commodity networking hardware(less bandwidth) ● Cluster consists of hundreds or thousands of machines(machine failures are common) ● ● Storage is provided by inexpensive IDE disks attached directly to individual machines Users submit jobs to a scheduling system 7
3. Implementation Embedded System Lab. (1) Map. Reduce library input file 조각 당 16~64 MB의 M 조각으로 분할 8
3. Implementation Embedded System Lab. (2) Master는 idle workers 선택 각 workers에게 map task or reduce task 할당 9
3. Implementation Embedded System Lab. (3) Map worker는 input data에서 key/value pairs를 parses 하여 사용자 가 정의한 Map function에 전달 Map function에 의해 생성된 intermediate key/value pairs 는 memory에 buffer됨 10
3. Implementation Embedded System Lab. (4) buffer된 memory 주기적으로 local disc에 written하고 local disc 에서 bufferd pairs는 master로 다시 전달되 고 master는 reduce function에 이 위 치를 전달 11
3. Implementation Embedded System Lab. (5)master가 local disc의 위치를 reduce worker에게 통보하면 map workers의 buffer data 읽음 reduce worker가 모든 intermediate data 읽을 경우 intermediate key를 기 준으로 sorts 12
3. Implementation Embedded System Lab. (6) reduce worker는 key에 상응하는 set of intermediate values를 Reduce function으로 전달 Reduce function의 output은 Reduce partition의 final output file에 추가 됨 13
3. Implementation Embedded System Lab. Merges all intermediate values associated with the same intermediate key 14
3. Implementation Embedded System Lab. 15
3. Implementation Embedded System Lab. Fault Tolerance 많은 개수의 machines 사용 하여 많은 양의 data처리 하면 machine failures 빈번함 • Worker failure → re-execution • master가 주기적으로 모든 worker에게 pings 일정 시간 동안 응답 없으면 worker failed로 표시 • Map task or reduce task가 worker failed시 initial state로 reset 한뒤 rescheduling • Master failure → checkpoint • Master 주기적인 checkpoints 사용 하여 master task dies시 마지막 checkpointed state에서 새로운 copy 시작 • 현재 master 하나 뿐이기에 실패 가능성이 낮아 현재 구현에서는 master fails시 Map. Reduce computation 중단 됨 16
3. Implementation Embedded System Lab. Locality ● ● ● Network bandwidth는 computing environment에서 상대적으로 부족한 resource GFS로 관리되는 input data가 cluster 구성하는 machines의 local disks에 저장되어 있는 사실을 이용 network bandwidth 절약 Map. Reduce master는 input data의 위치 정보를 고려하여 해당 input data의 복제 본이 포함된 machine 에서 map task schedule 시도 실패 시 해당 작업의 input data 복제 본 근처에서 map task schedule 시도 Map. Reduce operations 시행할 때 대부분의 input data를 local에서 읽고 network bandwidth 소모 하지 않음 17
3. Implementation Embedded System Lab. Backup Tasks ● ● Straggler : Map. Reduce operation 총 소요 시간이 길어지는 일반적인 원인 Straggler 완화 mechanism − Master 진행 중인 task의 backup 실행 schedules − Large Map. Reduce operations 완료 시간을 크게 단축 (최대 40%) 40% ↑ 1283 seconds 891 seconds 18
4. Refinements Embedded System Lab. Refinement ● ● Different partitioning function − 사용자는 원하는 reduce task/output 수를 지정 Combiner function − Network를 통해 전송 되기 전에 데이터를 부분적으로 병합 → network bandwidth 절약 ● Different input/output types ● Skipping bad records − ● Local execution − ● Master는 다음 worker에게 악영향을 주는 record는 skip Local machine에서 Map. Reduce operation 에 대한 모든 작업을 sequentially하게 실행 하는 Map. Reduce library의 대체 구현(debugging problem 위해) Status info & Counters 19
5. Performance Embedded System Lab. 2가지 계산으로 성능 측정 • MR_Grep. Scan ○ 1 TB의 데이터 검색 특정 패턴 찾기 • MR_Sort ○ 1 TB의 데이터 정렬 Cluster Configuration Specifications Cluster 1800 machines Memory 4 GB Processors Dual-processor 2 GHz Xeons with Hyper-threading Hard disk Dual 160 GB IDE disks Network Gigabit Ethernet per machine bandwidth approximately 100 Gbps 20
5. Performance Grep Embedded System Lab. 1764 worker assigned 30 GB/s map task finish ● ● 100억 개의 100 -byte records를 scans하여 드문 3문자 패턴 searching(the pattern occurs in 92, 337 records) Input 약 64 MB 조각(M = 15000) 으로 분할되고 entire output은 하나의 파일에 배치 됨(R=1) 21
5. Performance Sort Embedded System Lab. 891 seconds ● Backup tasks로 completion time 개선 ● System manages machine failures relatively quickly 1283 seconds 40% ↑ 933 seconds 5% ↑ 22
6. Conclusions ● Large-scale computations를 크게 단순화 ● 세부 사항을 library 가 처리 ● ● Embedded System Lab. Parallelization knowledge 크게 필요하지 않음 (user가 low level parallelization details 을 처리 하지 않아도 됨 Fault tolerance 제공 23
Embedded System Lab. Map. Reduce : Simplified Data Processing on Large Clusters Jeffrey Dean & Sanjay Ghemawat Thank You! 2019. 11. 18 Presentation by Jeeweon, Lee leejeeweon 93@gmail. com
- Slides: 24