SlideShare a Scribd company logo
Tuning Hadoop for Performance
                      Srigurunath Chakravarthi
                      Performance Enginnering,
                          Yahoo! Bangalore
                             Doc Ver 1.0
                            March 5, 2010

Yahoo! Confidential                              1
Outline


  •         Why worry about performance?
  •         Recap of Hadoop Design
          –           Control Flow (Map, Shuffle, Reduce phases)
  •         Key performance considerations
  •         Thumb rules for tuning Hadoop
          –           Cluster level
          –           Application level
  •         Wrap up




Yahoo! Confidential                                                2
Why Worry About Performance?

  Why Measure/Track Performance?
  •         Tells your ROI on hardware.
  •         Surfaces silent performance regressions from
          –           Faulty and “slow” (malfunctioning) disks/NICs/CPUs
          –           Software/Configuration Upgrades, etc.
  Why Improve Performance?
  •         Faster results and better ROI :-)
  •         There are non-obvious, yet simple ways to
          –           Push up cluster/app performance without adding hardware
          –           Unlock cluster/app performance by mitigating bottlenecks


  And The Good News Is… Hadoop is designed to be tunable by users
          –           25+ performance influencing tunable parameters
          –           Cluster-wide and Job-specific controls
Yahoo! Confidential                                                              3
Recap of Hadoop Design


                      Map
                        Map
                      Task                      Task
                         Map
                       Task
                         Task                  Tracker
                                                          Reduce
                                                           Reduce
                                                           Task
   HDFS                          Local Disk                 Task

                      Map
                        Map                                                HDFS
                      Task
                         Map                    Task
                       Task                    Tracker    Local Disk
                         Task

    HDFS                         Local Disk
                                                          Reduce
                                                           Reduce
                                                           Task
                                                            Task
                       Map
                         Map
                       Task                      Task
                          Map
                        Task
                          Task                  Tracker                    HDFS
                                                          Local Disk
     HDFS                         Local Disk

Yahoo! Confidential                                                    4
Key Performance influencing factors

  Multiple Orthogonal factors
  •         Cluster Hardware Configuration
          –           # cores; RAM, # disks per node; disk speeds; network topology, etc.
                  Example: If your app is data intensive, can you drive sufficiently good disk throughput?
                      Do you have sufficient RAM (to decrease # trips to disk)?
  •         Application logic related
          –           Degree of Parallelism: M-R favors embarrassingly parallel apps
          –           Load Balance: Slowest tasks impact M-R job completion time.
  •         System Bottlenecks
          –           Thrashing your CPU/memory/disks/network degrades performance severely
  •         Resource Under-utilization
          –           Your app may not be pushing system limits enough.
  •         Scale
          –           Bottlenecks from centralized components (Job Tracker and Name Node).


Yahoo! Confidential                                                                          5
Key Performance influencing factors
                           Tuning Opportunities

  •         Cluster Hardware Configuration
          –           Hardware Purchase/Upgrade time decision. (Outside scope of this pres.)
  •         Application logic related
          –           Tied to app logic. (Outside scope of this presentation.)
          –           Countering Load Balance:
                  •       Typically mitigated by adapting user algorithm to avoid “long tails”.
                  •       Examples: Re-partitioning; Imposing per-task hard-limits on input/output sizes.
          –           Handling Non-Parallelism:
                  •       Run app as a pipeline of M-R jobs. Sequential portions as single reducers.
          –           Record Combining:
                  •       Map-side and reduce-side combiners
  •         System Bottlenecks & Resource Under-utilization
          –           These can be mitigated by tuning Hadoop (discussed more).
  •         Scale
          –           Relevant to large (1000+ node) clusters. (Outside scope of this pres.)
Yahoo! Confidential                                                                               6
System Usage Characteristics
                        Resource Intensiveness
              M-R Step       CPU    Memory   Network   Disk   Notes

              Serve Map                      Yes*      Yes    *For remote maps (minority)
              Input
              Execute Map    Yes*                             *Depends on App
              Function

              Store Map      Yes*   Yes+               Yes    *If compression is ON
              Output                                          +Memory Sensitive
              Shuffle               Yes+     Yes       Yes    +Memory Sensitive

              Execute        Yes*                             *Depends on App
              Reduce Func.

              Store Reduce   Yes*            Yes+      Yes    *If compression is ON
              Output                                          +For replication factor > 1




Yahoo! Confidential                                                          7
Cluster Level Tuning – CPU & Memory

  Map and Reducers task execution: Pushing Up CPU Utilization
  Tunables
  –           mapred.tasktracker.map.tasks.maximum: The maximum number of map tasks that will
              be run simultaneously by a task tracker (aka “map slots” / “M”).
  –           mapred.tasktracker.reduce.tasks.maximum: The maximum number of reduce tasks that
              will be run simultaneously by a task tracker (aka “reduce slots” / “R”).


  Thumb Rules for Tuning
  –           Over-subscribe cores (Set total “slots” > num cores)
  –           Throw more slots at the dominant phase.
  –           Don’t exceed mem limit and hit swap! (Adjust Java heap via mapred.child.javaopts)
  –           Example:
          –           8 cores. Assume map tasks account for 75% of CPU time.
          –           Per Over-subscribing rule: Total Slots (M+R) = 10 (on 8 cores)
          –           Per Biasing rule: Create more Map Slots than Reduce Slots. E.g., M,R = (8, 2) or (7,3)

Yahoo! Confidential                                                                                 8
Cluster Level Tuning – DFS Throughput

  DFS Data Read/Write: Pushing up throughput
  Tunables
  –           dfs.block.size: The default block size for new files (aka “DFS Block Size”).



  Thumb Rules for Tuning
  –           The default of 128 MB is normally a good size. Lower if disk-space is a crunch.
  –           Size it to avoid serving multiple blocks to a map task. May forsake data locality.
  –           Alternately tailor the number of map tasks at the job level.
  –           Example:
          –           If your data sets that logically go to a single map are ~180-190 MB in size, set block
                      size to 196 MB.




Yahoo! Confidential                                                                         9
Job Level Tuning –Task Granularity

  Setting optimal number of Map and Reduce tasks
  Tunables
  –         # map tasks in your job (“m”) – controlled via input splits.
  –         “mapred.reduce.tasks”: # reduce tasks in your job (“r”)



  Thumb Rules for Tuning
  –         Set # map tasks to read off approximately 1 DFS block worth of data.
  –         Use multiple “map waves”, to hide shuffle latency.
  –         Look for a “sweet range” of # of waves (this is empirical).
  # Reduce tasks:
  –         Use a single reducer wave. Second wave adds extra shuffle latency.
  –         Use multiple reducer waves, iff reducer task can’t scale in memory.


  Num “map waves” = Total # of map tasks / Total # of map slots in cluster
Yahoo! Confidential                                                               10
Job Level Tuning – io.sort.mb

  Buffering to Minimize Disk Writes
  Tunables
  –         io.sort.mb Size of map-side buffer to store and merge map output before spilling to
            disk. (Map-side buffer)
  –         fs.inmemorysize.mb Size of reduce-side buffer for storing & merging multi-map
            output before spilling to disk. (Reduce side-buffer)


  Thumb Rules for Tuning
  –         Set these to ~70% of Java heap size. Pick heap sizes to utilize ~80% RAM across
            all processes (maps, reducers, TT, DN, other)
  –         Set it small enough to avoid swap activity, but
  –         Set it large enough to minimize disk spills.
  –         Ensure that io.sort.factor is set large enough to allow full use of buffer space.
  –         Balance space for output records (default 95%) & record meta-data (5%)
                  •   Use io.sort.spill.percent and io.sort.record.percent
Yahoo! Confidential                                                               11
Job Level Tuning – Compression

  Compression: Trades off CPU cycles to reduce disk/network traffic.
  Tunables
  –         mapred.compress.map.output Should intermediate map output be compressed?
  –         mapred.output.compress Should final (reducer) output be compressed?



  Thumb Rules for Tuning
  –         Turn them on unless CPU is your bottleneck.
  –         Use BLOCK compression: Set mapred.(map).output.compression.type to BLOCK
  –         LZO does better than default (Zlib) – mapred.(map).output.compression.codec
  –         Try Intel® IPP libraries for even better compression speed on Intel platforms.


  Turn map output compression ON cluster-wide. Compression invariably improves
       performance of apps handling large data on modern multi-core systems.


Yahoo! Confidential                                                              12
Tuning multiple parameters

  •           Multiple tunables for memory, CPU, disk and network.
  •           Only the prominent ones were covered here.
  •           Inter-dependent. Can’t tune them independently.
  •           Meta rules to help multi-tune :
          -           Avoid swap. Cost of swapping is high.
          -           Minimize spills. Spilling is not as evil as swapping.
          -           It generally pays to compress and to over-subscribe cores.
  •           Several other tunable parameters exist. Look them up in config/
          –           Core-default.xml, Mapred-default.xml, dfs-default.xml
          –           Core-site.xml, Mapred-site.xml, dfs-site.xml




Yahoo! Confidential                                                                13
Sample tuning gains for a 60-job app pipeline
                        (“Mini Webmap on 64 node cluster”)

   Setting            #Maps (m)                 #Reduces   M,R slots   io.sort.mb   Job exec    Improvement
                                                (r)                                 time        over Baseline
                                                                                    (sec)

   Baseline           Two Heaviest Apps: 1215   243        4,4         500          7682        -
                      All Other Apps: 243


   Tuned1             Two Heaviest Apps: 800    243        8,3         1000         7084        7.78%
                      All Other Apps: 243


   Tuned2             Two Heaviest Apps: 800    200        8,3         1000         6496        15.43%
                      All Other Apps: 200


   Tuned3             Two Heaviest Apps: 800    150        8,3         1000         5689        22.42%
                      All Other Apps: 150

   Contribution       major                     moderate   moderate    minor
   to
   improvement


Yahoo! Confidential                                                                        14
Acknowledgements

  Many of the observations presented here came as learnings and insights from
  •         Webmap Performance Engineers @ Y!
          –           Mahadevan Iyer, Arvind Murthy, Rohit Jalan
  •         Grid Performance Engineers @ Y!
          –           Rajesh Balamohan, Harish Mallipeddi, Janardhana Reddy
  •         Hadoop Dev Engineers @ Y!
          –           Devaraj Das, Jothi Padmanabhan, Hemanth Yamijala




  Questions: sriguru@yahoo-inc.com




Yahoo! Confidential                                                           15

More Related Content

What's hot (20)

PDF
Hadoop Performance Optimization at Scale, Lessons Learned at Twitter
DataWorks Summit
 
PDF
Optimizing Dell PowerEdge Configurations for Hadoop
Mike Pittaro
 
PDF
Hadoop Internals (2.3.0 or later)
Emilio Coppa
 
PDF
Hadoop 2.0 handout 5.0
Manaranjan Pradhan
 
PPTX
Compression Options in Hadoop - A Tale of Tradeoffs
DataWorks Summit
 
PDF
Hortonworks.Cluster Config Guide
Douglas Bernardini
 
PDF
Hadoop scheduler
Subhas Kumar Ghosh
 
PPTX
Optimizing your Infrastrucure and Operating System for Hadoop
DataWorks Summit
 
PPTX
Hadoop Architecture_Cluster_Cap_Plan
Narayana B
 
PPTX
Hadoop MapReduce Introduction and Deep Insight
Hanborq Inc.
 
PPTX
February 2014 HUG : Pig On Tez
Yahoo Developer Network
 
PPTX
Pig on Tez - Low Latency ETL with Big Data
DataWorks Summit
 
PDF
Improving Apache Spark by Taking Advantage of Disaggregated Architecture
Databricks
 
PPTX
Pig on Tez: Low Latency Data Processing with Big Data
DataWorks Summit
 
PDF
BIGDATA- Survey on Scheduling Methods in Hadoop MapReduce
Mahantesh Angadi
 
ODP
Hadoop2.2
Sreejith P
 
PPTX
03 pig intro
Subhas Kumar Ghosh
 
PDF
Hadoop - Disk Fail In Place (DFIP)
mundlapudi
 
PPT
Hadoop 1.x vs 2
Rommel Garcia
 
PPTX
Hadoop & HDFS for Beginners
Rahul Jain
 
Hadoop Performance Optimization at Scale, Lessons Learned at Twitter
DataWorks Summit
 
Optimizing Dell PowerEdge Configurations for Hadoop
Mike Pittaro
 
Hadoop Internals (2.3.0 or later)
Emilio Coppa
 
Hadoop 2.0 handout 5.0
Manaranjan Pradhan
 
Compression Options in Hadoop - A Tale of Tradeoffs
DataWorks Summit
 
Hortonworks.Cluster Config Guide
Douglas Bernardini
 
Hadoop scheduler
Subhas Kumar Ghosh
 
Optimizing your Infrastrucure and Operating System for Hadoop
DataWorks Summit
 
Hadoop Architecture_Cluster_Cap_Plan
Narayana B
 
Hadoop MapReduce Introduction and Deep Insight
Hanborq Inc.
 
February 2014 HUG : Pig On Tez
Yahoo Developer Network
 
Pig on Tez - Low Latency ETL with Big Data
DataWorks Summit
 
Improving Apache Spark by Taking Advantage of Disaggregated Architecture
Databricks
 
Pig on Tez: Low Latency Data Processing with Big Data
DataWorks Summit
 
BIGDATA- Survey on Scheduling Methods in Hadoop MapReduce
Mahantesh Angadi
 
Hadoop2.2
Sreejith P
 
03 pig intro
Subhas Kumar Ghosh
 
Hadoop - Disk Fail In Place (DFIP)
mundlapudi
 
Hadoop 1.x vs 2
Rommel Garcia
 
Hadoop & HDFS for Beginners
Rahul Jain
 

Similar to Hadoop Summit 2010 Tuning Hadoop To Deliver Performance To Your Application (20)

PDF
The Search Is Over: Integrating Solr and Hadoop in the Same Cluster to Simpli...
lucenerevolution
 
PDF
The Search Is Over: Integrating Solr and Hadoop in the Same Cluster to Simpli...
lucenerevolution
 
PDF
Hadoop's Role in the Big Data Architecture, OW2con'12, Paris
OW2
 
PDF
hadoop @ Ibmbigdata
Eric Baldeschwieler
 
PDF
Starfish: A Self-tuning System for Big Data Analytics
Grant Ingersoll
 
PPTX
How to Make Hadoop Easy, Dependable and Fast
MapR Technologies
 
PPTX
Seattle Scalability Meetup - Ted Dunning - MapR
clive boulton
 
PPT
Dreamforce_2012_Hadoop_Use_Cases
Narayan Bharadwaj
 
PPTX
Performance Management in ‘Big Data’ Applications
Michael Kopp
 
PDF
Multilevel aggregation for Hadoop/MapReduce
Tsuyoshi OZAWA
 
PDF
Hadoop on Azure, Blue elephants
Ovidiu Dimulescu
 
PDF
Hadoop Summit San Diego Feb2013
Narayan Bharadwaj
 
PDF
Big Data launch keynote Singapore Patrick Buddenbaum
IntelAPAC
 
PDF
Meta scale kognitio hadoop webinar
Kognitio
 
PPTX
Big Data, Hadoop, Hortonworks and Microsoft HDInsight
Hortonworks
 
PDF
Prdc2012
Yusuke Shimizu
 
PDF
Keynote from ApacheCon NA 2011
Hortonworks
 
PDF
Common and unique use cases for Apache Hadoop
Brock Noland
 
PDF
Commonanduniqueusecases 110831113310-phpapp01
eimhee
 
PDF
Google Compute and MapR
MapR Technologies
 
The Search Is Over: Integrating Solr and Hadoop in the Same Cluster to Simpli...
lucenerevolution
 
The Search Is Over: Integrating Solr and Hadoop in the Same Cluster to Simpli...
lucenerevolution
 
Hadoop's Role in the Big Data Architecture, OW2con'12, Paris
OW2
 
hadoop @ Ibmbigdata
Eric Baldeschwieler
 
Starfish: A Self-tuning System for Big Data Analytics
Grant Ingersoll
 
How to Make Hadoop Easy, Dependable and Fast
MapR Technologies
 
Seattle Scalability Meetup - Ted Dunning - MapR
clive boulton
 
Dreamforce_2012_Hadoop_Use_Cases
Narayan Bharadwaj
 
Performance Management in ‘Big Data’ Applications
Michael Kopp
 
Multilevel aggregation for Hadoop/MapReduce
Tsuyoshi OZAWA
 
Hadoop on Azure, Blue elephants
Ovidiu Dimulescu
 
Hadoop Summit San Diego Feb2013
Narayan Bharadwaj
 
Big Data launch keynote Singapore Patrick Buddenbaum
IntelAPAC
 
Meta scale kognitio hadoop webinar
Kognitio
 
Big Data, Hadoop, Hortonworks and Microsoft HDInsight
Hortonworks
 
Prdc2012
Yusuke Shimizu
 
Keynote from ApacheCon NA 2011
Hortonworks
 
Common and unique use cases for Apache Hadoop
Brock Noland
 
Commonanduniqueusecases 110831113310-phpapp01
eimhee
 
Google Compute and MapR
MapR Technologies
 
Ad

More from Yahoo Developer Network (20)

PDF
Developing Mobile Apps for Performance - Swapnil Patel, Verizon Media
Yahoo Developer Network
 
PDF
Athenz - The Open-Source Solution to Provide Access Control in Dynamic Infras...
Yahoo Developer Network
 
PDF
Athenz & SPIFFE, Tatsuya Yano, Yahoo Japan
Yahoo Developer Network
 
PDF
Athenz with Istio - Single Access Control Model in Cloud Infrastructures, Tat...
Yahoo Developer Network
 
PDF
CICD at Oath using Screwdriver
Yahoo Developer Network
 
PDF
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath
Yahoo Developer Network
 
PPTX
How @TwitterHadoop Chose Google Cloud, Joep Rottinghuis, Lohit VijayaRenu
Yahoo Developer Network
 
PDF
The Future of Hadoop in an AI World, Milind Bhandarkar, CEO, Ampool
Yahoo Developer Network
 
PPTX
Apache YARN Federation and Tez at Microsoft, Anupam Upadhyay, Adrian Nicoara,...
Yahoo Developer Network
 
PPTX
Containerized Services on Apache Hadoop YARN: Past, Present, and Future, Shan...
Yahoo Developer Network
 
PDF
HDFS Scalability and Security, Daryn Sharp, Senior Engineer, Oath
Yahoo Developer Network
 
PPTX
Hadoop {Submarine} Project: Running deep learning workloads on YARN, Wangda T...
Yahoo Developer Network
 
PDF
Moving the Oath Grid to Docker, Eric Badger, Oath
Yahoo Developer Network
 
PDF
Architecting Petabyte Scale AI Applications
Yahoo Developer Network
 
PDF
Introduction to Vespa – The Open Source Big Data Serving Engine, Jon Bratseth...
Yahoo Developer Network
 
PPTX
Jun 2017 HUG: YARN Scheduling – A Step Beyond
Yahoo Developer Network
 
PDF
Jun 2017 HUG: Large-Scale Machine Learning: Use Cases and Technologies
Yahoo Developer Network
 
PPTX
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
Yahoo Developer Network
 
PPTX
February 2017 HUG: Exactly-once end-to-end processing with Apache Apex
Yahoo Developer Network
 
PPTX
February 2017 HUG: Data Sketches: A required toolkit for Big Data Analytics
Yahoo Developer Network
 
Developing Mobile Apps for Performance - Swapnil Patel, Verizon Media
Yahoo Developer Network
 
Athenz - The Open-Source Solution to Provide Access Control in Dynamic Infras...
Yahoo Developer Network
 
Athenz & SPIFFE, Tatsuya Yano, Yahoo Japan
Yahoo Developer Network
 
Athenz with Istio - Single Access Control Model in Cloud Infrastructures, Tat...
Yahoo Developer Network
 
CICD at Oath using Screwdriver
Yahoo Developer Network
 
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath
Yahoo Developer Network
 
How @TwitterHadoop Chose Google Cloud, Joep Rottinghuis, Lohit VijayaRenu
Yahoo Developer Network
 
The Future of Hadoop in an AI World, Milind Bhandarkar, CEO, Ampool
Yahoo Developer Network
 
Apache YARN Federation and Tez at Microsoft, Anupam Upadhyay, Adrian Nicoara,...
Yahoo Developer Network
 
Containerized Services on Apache Hadoop YARN: Past, Present, and Future, Shan...
Yahoo Developer Network
 
HDFS Scalability and Security, Daryn Sharp, Senior Engineer, Oath
Yahoo Developer Network
 
Hadoop {Submarine} Project: Running deep learning workloads on YARN, Wangda T...
Yahoo Developer Network
 
Moving the Oath Grid to Docker, Eric Badger, Oath
Yahoo Developer Network
 
Architecting Petabyte Scale AI Applications
Yahoo Developer Network
 
Introduction to Vespa – The Open Source Big Data Serving Engine, Jon Bratseth...
Yahoo Developer Network
 
Jun 2017 HUG: YARN Scheduling – A Step Beyond
Yahoo Developer Network
 
Jun 2017 HUG: Large-Scale Machine Learning: Use Cases and Technologies
Yahoo Developer Network
 
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
Yahoo Developer Network
 
February 2017 HUG: Exactly-once end-to-end processing with Apache Apex
Yahoo Developer Network
 
February 2017 HUG: Data Sketches: A required toolkit for Big Data Analytics
Yahoo Developer Network
 
Ad

Recently uploaded (20)

PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
July Patch Tuesday
Ivanti
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 

Hadoop Summit 2010 Tuning Hadoop To Deliver Performance To Your Application

  • 1. Tuning Hadoop for Performance Srigurunath Chakravarthi Performance Enginnering, Yahoo! Bangalore Doc Ver 1.0 March 5, 2010 Yahoo! Confidential 1
  • 2. Outline • Why worry about performance? • Recap of Hadoop Design – Control Flow (Map, Shuffle, Reduce phases) • Key performance considerations • Thumb rules for tuning Hadoop – Cluster level – Application level • Wrap up Yahoo! Confidential 2
  • 3. Why Worry About Performance? Why Measure/Track Performance? • Tells your ROI on hardware. • Surfaces silent performance regressions from – Faulty and “slow” (malfunctioning) disks/NICs/CPUs – Software/Configuration Upgrades, etc. Why Improve Performance? • Faster results and better ROI :-) • There are non-obvious, yet simple ways to – Push up cluster/app performance without adding hardware – Unlock cluster/app performance by mitigating bottlenecks And The Good News Is… Hadoop is designed to be tunable by users – 25+ performance influencing tunable parameters – Cluster-wide and Job-specific controls Yahoo! Confidential 3
  • 4. Recap of Hadoop Design Map Map Task Task Map Task Task Tracker Reduce Reduce Task HDFS Local Disk Task Map Map HDFS Task Map Task Task Tracker Local Disk Task HDFS Local Disk Reduce Reduce Task Task Map Map Task Task Map Task Task Tracker HDFS Local Disk HDFS Local Disk Yahoo! Confidential 4
  • 5. Key Performance influencing factors Multiple Orthogonal factors • Cluster Hardware Configuration – # cores; RAM, # disks per node; disk speeds; network topology, etc. Example: If your app is data intensive, can you drive sufficiently good disk throughput? Do you have sufficient RAM (to decrease # trips to disk)? • Application logic related – Degree of Parallelism: M-R favors embarrassingly parallel apps – Load Balance: Slowest tasks impact M-R job completion time. • System Bottlenecks – Thrashing your CPU/memory/disks/network degrades performance severely • Resource Under-utilization – Your app may not be pushing system limits enough. • Scale – Bottlenecks from centralized components (Job Tracker and Name Node). Yahoo! Confidential 5
  • 6. Key Performance influencing factors Tuning Opportunities • Cluster Hardware Configuration – Hardware Purchase/Upgrade time decision. (Outside scope of this pres.) • Application logic related – Tied to app logic. (Outside scope of this presentation.) – Countering Load Balance: • Typically mitigated by adapting user algorithm to avoid “long tails”. • Examples: Re-partitioning; Imposing per-task hard-limits on input/output sizes. – Handling Non-Parallelism: • Run app as a pipeline of M-R jobs. Sequential portions as single reducers. – Record Combining: • Map-side and reduce-side combiners • System Bottlenecks & Resource Under-utilization – These can be mitigated by tuning Hadoop (discussed more). • Scale – Relevant to large (1000+ node) clusters. (Outside scope of this pres.) Yahoo! Confidential 6
  • 7. System Usage Characteristics Resource Intensiveness M-R Step CPU Memory Network Disk Notes Serve Map Yes* Yes *For remote maps (minority) Input Execute Map Yes* *Depends on App Function Store Map Yes* Yes+ Yes *If compression is ON Output +Memory Sensitive Shuffle Yes+ Yes Yes +Memory Sensitive Execute Yes* *Depends on App Reduce Func. Store Reduce Yes* Yes+ Yes *If compression is ON Output +For replication factor > 1 Yahoo! Confidential 7
  • 8. Cluster Level Tuning – CPU & Memory Map and Reducers task execution: Pushing Up CPU Utilization Tunables – mapred.tasktracker.map.tasks.maximum: The maximum number of map tasks that will be run simultaneously by a task tracker (aka “map slots” / “M”). – mapred.tasktracker.reduce.tasks.maximum: The maximum number of reduce tasks that will be run simultaneously by a task tracker (aka “reduce slots” / “R”). Thumb Rules for Tuning – Over-subscribe cores (Set total “slots” > num cores) – Throw more slots at the dominant phase. – Don’t exceed mem limit and hit swap! (Adjust Java heap via mapred.child.javaopts) – Example: – 8 cores. Assume map tasks account for 75% of CPU time. – Per Over-subscribing rule: Total Slots (M+R) = 10 (on 8 cores) – Per Biasing rule: Create more Map Slots than Reduce Slots. E.g., M,R = (8, 2) or (7,3) Yahoo! Confidential 8
  • 9. Cluster Level Tuning – DFS Throughput DFS Data Read/Write: Pushing up throughput Tunables – dfs.block.size: The default block size for new files (aka “DFS Block Size”). Thumb Rules for Tuning – The default of 128 MB is normally a good size. Lower if disk-space is a crunch. – Size it to avoid serving multiple blocks to a map task. May forsake data locality. – Alternately tailor the number of map tasks at the job level. – Example: – If your data sets that logically go to a single map are ~180-190 MB in size, set block size to 196 MB. Yahoo! Confidential 9
  • 10. Job Level Tuning –Task Granularity Setting optimal number of Map and Reduce tasks Tunables – # map tasks in your job (“m”) – controlled via input splits. – “mapred.reduce.tasks”: # reduce tasks in your job (“r”) Thumb Rules for Tuning – Set # map tasks to read off approximately 1 DFS block worth of data. – Use multiple “map waves”, to hide shuffle latency. – Look for a “sweet range” of # of waves (this is empirical). # Reduce tasks: – Use a single reducer wave. Second wave adds extra shuffle latency. – Use multiple reducer waves, iff reducer task can’t scale in memory. Num “map waves” = Total # of map tasks / Total # of map slots in cluster Yahoo! Confidential 10
  • 11. Job Level Tuning – io.sort.mb Buffering to Minimize Disk Writes Tunables – io.sort.mb Size of map-side buffer to store and merge map output before spilling to disk. (Map-side buffer) – fs.inmemorysize.mb Size of reduce-side buffer for storing & merging multi-map output before spilling to disk. (Reduce side-buffer) Thumb Rules for Tuning – Set these to ~70% of Java heap size. Pick heap sizes to utilize ~80% RAM across all processes (maps, reducers, TT, DN, other) – Set it small enough to avoid swap activity, but – Set it large enough to minimize disk spills. – Ensure that io.sort.factor is set large enough to allow full use of buffer space. – Balance space for output records (default 95%) & record meta-data (5%) • Use io.sort.spill.percent and io.sort.record.percent Yahoo! Confidential 11
  • 12. Job Level Tuning – Compression Compression: Trades off CPU cycles to reduce disk/network traffic. Tunables – mapred.compress.map.output Should intermediate map output be compressed? – mapred.output.compress Should final (reducer) output be compressed? Thumb Rules for Tuning – Turn them on unless CPU is your bottleneck. – Use BLOCK compression: Set mapred.(map).output.compression.type to BLOCK – LZO does better than default (Zlib) – mapred.(map).output.compression.codec – Try Intel® IPP libraries for even better compression speed on Intel platforms. Turn map output compression ON cluster-wide. Compression invariably improves performance of apps handling large data on modern multi-core systems. Yahoo! Confidential 12
  • 13. Tuning multiple parameters • Multiple tunables for memory, CPU, disk and network. • Only the prominent ones were covered here. • Inter-dependent. Can’t tune them independently. • Meta rules to help multi-tune : - Avoid swap. Cost of swapping is high. - Minimize spills. Spilling is not as evil as swapping. - It generally pays to compress and to over-subscribe cores. • Several other tunable parameters exist. Look them up in config/ – Core-default.xml, Mapred-default.xml, dfs-default.xml – Core-site.xml, Mapred-site.xml, dfs-site.xml Yahoo! Confidential 13
  • 14. Sample tuning gains for a 60-job app pipeline (“Mini Webmap on 64 node cluster”) Setting #Maps (m) #Reduces M,R slots io.sort.mb Job exec Improvement (r) time over Baseline (sec) Baseline Two Heaviest Apps: 1215 243 4,4 500 7682 - All Other Apps: 243 Tuned1 Two Heaviest Apps: 800 243 8,3 1000 7084 7.78% All Other Apps: 243 Tuned2 Two Heaviest Apps: 800 200 8,3 1000 6496 15.43% All Other Apps: 200 Tuned3 Two Heaviest Apps: 800 150 8,3 1000 5689 22.42% All Other Apps: 150 Contribution major moderate moderate minor to improvement Yahoo! Confidential 14
  • 15. Acknowledgements Many of the observations presented here came as learnings and insights from • Webmap Performance Engineers @ Y! – Mahadevan Iyer, Arvind Murthy, Rohit Jalan • Grid Performance Engineers @ Y! – Rajesh Balamohan, Harish Mallipeddi, Janardhana Reddy • Hadoop Dev Engineers @ Y! – Devaraj Das, Jothi Padmanabhan, Hemanth Yamijala Questions: [email protected] Yahoo! Confidential 15