版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、MapReduce:Simplified Data Processing on Large ClustersThese are slides from Dan Welds class at U. Washington(who in turn made his slides based on those by Jeff Dean, Sanjay Ghemawat, Google, Inc.)Motivation Large-Scale Data ProcessingqWant to use 1000s of CPUs But dont want hassle of managing things
2、 MapReduce providesqAutomatic parallelization & distributionqFault toleranceqI/O schedulingqMonitoring & status updatesMap/Reduce Map/Reduce qProgramming model from Lisp q(and other functional languages) Many problems can be phrased this way Easy to distribute across nodes Nice retry/failure semanti
3、csMap in Lisp (Scheme) (map f list list2 list3 ) (map square (1 2 3 4)q(1 4 9 16) (reduce + (1 4 9 16)q(+ 16 (+ 9 (+ 4 1) ) )q30 (reduce + (map square (map l1 l2)Unary operatorBinary operatorMap/Reduce ala Google map(key, val) is run on each item in setqemits new-key / new-val pairs reduce(key, vals
4、) is run for each unique key emitted by map()qemits final outputcount words in docsqInput consists of (url, contents) pairsqmap(key=url, val=contents): For each word w in contents, emit (w, “1”)qreduce(key=word, values=uniq_counts): Sum all “1”s in values list Emit result “(word, sum)”Count, Illustr
5、atedmap(key=url, val=contents):For each word w in contents, emit (w, “1”)reduce(key=word, values=uniq_counts):Sum all “1”s in values listEmit result “(word, sum)”see bob throwsee spot runsee1bob1 run1see 1spot 1throw1bob1 run1see 2spot 1throw1GrepqInput consists of (url+offset, single line)qmap(key=
6、url+offset, val=line): If contents matches regexp, emit (line, “1”)qreduce(key=line, values=uniq_counts): Dont do anything; just emit lineReverse Web-Link Graph MapqFor each URL linking to target, qOutput pairs ReduceqConcatenate list of all source URLsqOutputs: pairsInverted Index Map ReduceExample
7、 uses: distributed grepdistributed sort web link-graph reversal term-vector / hostweb access log stats inverted index construction document clustering machine learning statistical machine translation . . .Model is Widely ApplicableMapReduce Programs In Google Source Tree Typical cluster: 100s/1000s
8、of 2-CPU x86 machines, 2-4 GB of memory Limited bisection bandwidth Storage is on local IDE disks GFS: distributed file system manages data (SOSP03) Job scheduling system: jobs made up of tasks, scheduler assigns tasks to machines Implementation is a C+ library linked into user programs Implementati
9、on OverviewExecutionHow is this distributed?1.Partition input key/value pairs into chunks, run map() tasks in parallel2.After all map()s are complete, consolidate all emitted values for each unique emitted key3.Now partition space of output map keys, and run reduce() in parallelIf map() or reduce()
10、fails, reexecute!Job ProcessingJobTrackerTaskTracker 0TaskTracker 1TaskTracker 2TaskTracker 3TaskTracker 4TaskTracker 51. Client submits “grep” job, indicating code and input files2. JobTracker breaks input file into k chunks, (in this case 6). Assigns work to ttrackers.3. After map(), tasktrackers
11、exchange map-output to build reduce() keyspace4. JobTracker breaks reduce() keyspace into m chunks (in this case 6). Assigns work.5. reduce() output may go to NDFS“grep”Execution Parallel Execution Task Granularity & Pipelining Fine granularity tasks: map tasks machinesqMinimizes time for fault reco
12、veryqCan pipeline shuffling with map executionqBetter dynamic load balancing Often use 200,000 map & 5000 reduce tasks Running on 2000 machines Handled via re-executionqDetect failure via periodic heartbeatsqRe-execute completed + in-progress map tasksWhy?qRe-execute in progress reduce tasksqTask co
13、mpletion committed through master Robust: lost 1600/1800 machines once finished okSemantics in presence of failures: see paperFault Tolerance / WorkersMaster Failure Could handle, ? But dont yet q(master failure unlikely)Slow workers significantly delay completion time qOther jobs consuming resource
14、s on machine qBad disks w/ soft errors transfer data slowly qWeird things: processor caches disabled (!) Solution: Near end of phase, spawn backup tasks qWhichever one finishes first wins Dramatically shortens job completion time Refinement: Redundant ExecutionRefinement: Locality Optimization Maste
15、r scheduling policy: qAsks GFS for locations of replicas of input file blocks qMap tasks typically split into 64MB (GFS block size) qMap tasks scheduled so GFS input block replica are on same machine or same rack EffectqThousands of machines read input at local disk speed Without this, rack switches
16、 limit read rateRefinementSkipping Bad Records Map/Reduce functions sometimes fail for particular inputs qBest solution is to debug & fix Not always possible third-party source libraries qOn segmentation fault: Send UDP packet to master from signal handler Include sequence number of record being pro
17、cessed qIf master sees two failures for same record: Next worker is told to skip the record Sorting guarantees qwithin each reduce partition Compression of intermediate data CombinerqUseful for saving network bandwidth Local execution for debugging/testing User-defined countersOther RefinementsTests
18、 run on cluster of 1800 machines: q4 GB of memory qDual-processor 2 GHz Xeons with Hyperthreading qDual 160 GB IDE disks qGigabit Ethernet per machine qBisection bandwidth approximately 100 Gbps Two benchmarks:MR_GrepScan1010 100-byte records to extract records matching a rare pattern (92K matching
19、records) MR_SortSort 1010 100-byte records (modeled after TeraSort benchmark)PerformanceMR_GrepLocality optimization helps: 1800 machines read 1 TB at peak 31 GB/s W/out this, rack switches would limit to 10 GB/s Startup overhead is significant for short jobs Normal No backup tasks 200 processes kil
20、ledMR_Sort Backup tasks reduce job completion time a lot! System deals well with failures Rewrote Googles production indexingSystem using MapReduce qSet of 10,14,17,21,24 MapReduce operations qNew code is simpler, easier to understand 3800 lines C+ 700qMapReduce handles failures, slow machines qEasy
21、 to make indexing faster add more machinesExperienceNumber of jobs 29,423 Average job completion time634 secs Machine days used 79,186 days Input data read 3,288 TB Intermediate data produced 758 TB Output data written 193 TB Average worker machines per job 157Average worker deaths per job 1.2Average map tasks per job 3,351 Average reduce tasks per job 55 Unique map implementations 395 Uni
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026福建省能源石化集团有限责任公司秋季社会招聘120人笔试历年难易错考点试卷带答案解析
- 2026福建漳州市凌波康养集团有限公司招聘35人笔试历年难易错考点试卷带答案解析
- 2026浙江金华市兰溪市部分国有企业(交投集团)招聘14人笔试历年典型考点题库附带答案详解
- 2026江西吉安遂川县城控人力资源管理有限公司招聘园林绿化工作人员21人笔试历年常考点试题专练附带答案详解
- 2026广西南宁威宁集团第三季度招聘16人笔试历年常考点试题专练附带答案详解
- 2026年湖南高速养护工程有限公司招聘劳务派遣员工55人(长期)笔试历年典型考点题库附带答案详解
- 2026年合肥市轨道交通集团有限公司第二批次社会招聘12人笔试历年常考点试题专练附带答案详解
- 2026安徽蚌埠市东方投资集团有限公司招聘14人笔试历年常考点试题专练附带答案详解
- 2026四川绵阳科技城科技创新投资有限公司招聘公司中层管理人员及员工13人笔试历年备考题库附带答案详解
- 2026内蒙古锡林郭勒盟西乌旗欢乐羊牧场招聘15人笔试历年典型考点题库附带答案详解
- 输血科院感培训课件
- 餐饮2017全年营销方案
- JGJT178-2009 补偿收缩混凝土应用技术规程
- 质量控制计划QCP
- HOLZMA电子开料锯操作培训教材讲义课件
- 人教版八年级历史下册期末知识考点复习资料
- GB/T 41679-2022农林拖拉机和机械基本类型词汇
- GB/T 7582-2004声学听阈与年龄关系的统计分布
- GB/T 3075-2021金属材料疲劳试验轴向力控制方法
- GB/T 2970-2016厚钢板超声检测方法
- GB/T 14056.2-2011表面污染测定第2部分:氚表面污染
评论
0/150
提交评论