hadoop tuning

xianmin posted @ 2011年4月08日 15:32 in 研究 , 2838 阅读

30节点,10GB文件

shuffle性能不好,尝试调优

(1)初始设置:

core-site

 

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
        <property>
                <name>fs.default.name</name>
                <value>hdfs://cn50:9000</value>
        </property>
        <property>
                <name>hadoop.tmp.dir</name>
                <value>/workspace/xianmin/tmp</value>
        </property>
</configuration>

hdfs-site

 

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
        <property>
                <name>dfs.replication</name>
                <value>3</value>
        </property>
        <property>
                <name>dfs.data.dir</name>
                <value>/workspace/xianmin/data</value>
        </property>
        <property>
                <name>dfs.name.dir</name>
                <value>/workspace/xianmin/name</value>
        </property>
</configuration>

mapred-site

 

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
        <property>
                <name>mapred.job.tracker</name>
                <value>cn50:9001</value>
        </property>
        <property>
                <name>mapred.child.java.opts</name>
                <value>-Xmx1000m</value>
        </property>
        <property>
                <name>mapred.tasktracker.map.tasks.maximum</name>
                <value>1</value>
        </property>
        <property>
                <name>mapred.child.ulimit</name>
                <value>1572864</value>
        </property>
</configuration>

执行指定第四查询,结果为:

平均map 47

最坏map 130

shuffle 80

reduce 41

total 234 

(2)将conf/hdfs-site.xml中的dfs.block.size改为,134217728

平均map 47 -》49

最坏map 130 -》148

shuffle 80 -》93

reduce 41 -》29

total 234 -》238

没有本质性的改变,但是仍然保持更改后的dfs.block.size

(3)将conf/hdfs-site.xml中的dfs.namenode.handler.count改为40

平均map 49 -》48

最坏map 148 -》145

shuffle 93 -》75

reduce 29 -》48

total 238 -》233

没有本质性的改变,但是仍然保持更改后的dfs.namenode.handler.count

(4)将conf/core-site.xml中的

 

conf/core-site.xml fs.inmemory.size.mb 200 Larger amount of memory allocated for the in-memory file-system used to merge map-outputs at the reduces.
conf/core-site.xml mapreduce.task.io.sort.factor 100 More streams merged at once while sorting files.
conf/core-site.xml mapreduce.task.io.sort.mb 200 Higher memory-limit while sorting data.
conf/core-site.xml io.file.buffer.size 131072 Size of read/write buffer used in SequenceFiles.

没有格式化重启,运行后中间两个参数分别为,10和100

运行代价为:

平均map 48 -》48,47

最坏map 145 -》84,102

shuffle 75 -》174,97

reduce 48 -》3,46

total 233 -》221,256

参数保留,没有性能改变

(4)将conf/mapred-site.xml中的

mapreduce.map.java.opts=-Xmx1024M

mapreduce.reduce.java.opts=-Xmx1024M

运行代价:

 

平均map 47 -》46

最坏map 84 -》85

shuffle 97 -》163

reduce 46 -》23

total 256 -》225

没有本质改变,保留参数

(5)将conf/mapred-site.xml中的

mapreduce.reduce.shuffle.parallelcopies改为20

未格式化,重启,该参数没有改变,但是性能由于偶然因素提升?再次执行,性能回归

平均map 47 -》47,47

最坏map 85 -》129,83

shuffle 163 -》189,106

reduce 23 -》2,2

total 225 -》147,218

发现是操作错误,忘记更改conf/mapred-site.xml,shit,更改后,不格式化,重启,有效,也证明了不用去改mapred下的文件

性能得到提升。

平均map 47 -》47,45

最坏map 83 -》125,73(偶然)

shuffle 160+ -》130,63

reduce 2 -》3,2

total 218 -》188,172

把mapreduce.reduce.shuffle.parallelcopies改为50,测试性能下降

 

平均map 47 -》47,45-》48,47

最坏map 83 -》125,73(偶然)-》86,93

shuffle 160+ -》130,63-》82,160

reduce 2 -》3,2-》2,2

total 218 -》188,172-》236,211

把mapreduce.reduce.shuffle.parallelcopies重新改为20,性能得到提升,测试20,30,40变化吧

 

平均map 47 -》46-》45-》45,44,44

最坏map 83 -》83-》86-》85,81,68

shuffle 160+ -》84-》136-》130,68,67

reduce 2 -》2-》1-》3,4,2

total 211 -》196-》194-》180,202,182

暂时将该参数设为40

(6)将conf/mapred-site.xml中的mapreduce.jobtracker.handler.count改为20

平均map 46,45

最坏map 84,94

shuffle 96,161

reduce 29,2

total 239,210

暂时保留,虽然性能下降

(7)将conf/mapred-site.xml中的mapred.tasktracker.map.tasks.maximum改为7,也就是CPU核心个数-1

性能提升

平均map 48,46

最坏map 95,95

shuffle 57,60

reduce 22,2

total 133,108

(8)将conf/mapred-site.xml中的mapreduce.jobtracker.handler.count改为10

 

平均map 48,46-》47,46

最坏map 95,95-》91,84

shuffle 57,60-》60,51

reduce 22,2-》6,2

total 133,108-》125,102

(9)将conf/core-site.xml中的io.file.buffer.size改为262144二倍于原来

 

平均map 48,46-》47,46-》44,53,46,46

最坏map 95,95-》91,84-》72,111,84,76

shuffle 57,60-》60,51-》38,76,52,44

reduce 22,2-》6,2-》1,38,2,6

total 133,108-》125,102-》89,153,101,96

决定将该数值再增加为524288

 

平均map -》48,48,45,49,49

最坏map -》86,95,86,133,85

shuffle -》54,1,25,112,51

reduce -》2,2,20,29,3

total -》92,117,162,200,101

再次加倍1048576

 

平均map -》46,48,50

最坏map -》83,95,101

shuffle -》48,1,63

reduce -》7,2,3

total -》107,111,115

再次加倍2097152

 

平均map -》48,45,48

最坏map -》91,107,68

shuffle -》56,10,19

reduce -》8,4,2

total -》122,122,130

决定调回1048576

 

Avatar_small
seo service london 说:
2024年1月14日 19:06

Great and an informative article! this wonderful post


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter