hba读写性能测试调优_初稿
Hba读写性能测试调优
⽇期版本修订审批修订说明
2016.9.23 1.0章鑫初始版本
1 前⾔
本篇⽂章主要讲的是hba读写性能调优过程中遇到的⼀些技巧和配置项的修改,对于hba本⾝的原理和框架不会做太多的介绍。该⽂档中涉及到ycsb配置和使⽤⽅⾯的内容需要结合ycsb⼯具使⽤⽂档阅读理解。
2 配置
2.1 集群配置
[root@node1 ~]#uname -a
Linux node1.dcom 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x8
6_64 GNU/Linux
[root@node1 ~]# top
top - 10:02:40 up 51 days, 12:39, 11 urs, load average: 1.42, 1.23, 1.04
Tasks: 414 total, 1 running, 413 sleeping, 0 stopped, 0 zombie
%Cpu(s): 1.6 us, 0.4 sy, 0.0 ni, 97.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 65772144 total, 23124796 free, 8079632 ud, 34567716 buff/cache
KiB Swap: 0 total, 0 free, 0 ud. 56828368 avail Mem
[root@node1 ~]# free -m #64G内存
total ud free shared buff/cache available
Mem: 64230 7899 23391 475 32939 55486
Swap: 0 0 0
[root@node1 ~]# df -Thlc50
Filesystem Type Size Ud Avail U% Mounted on
/dev/mapper/centos-root xfs 231G 11G 221G 5% /
devtmpfs devtmpfs 32G 0 32G 0% /dev
tmpfs tmpfs 32G 24K 32G 1% /dev/shm
tmpfs tmpfs 32G 588M 31G 2% /run
tmpfs tmpfs 32G 0 32G 0% /sys/fs/cgroup
/dev/sda1 xfs 494M 130M 364M 27% /boot
/dev/mapper/centos-var xfs 100G 6.7G 94G 7% /var
/dev/mapper/centos-opt xfs 600G 733M 599G 1% /opt
tmpfs tmpfs 6.3G 0 6.3G 0% /run/ur/0
/
dev/sdc xfs 932G 66G 866G 8% /opt/hdata
/dev/sdb1 xfs 932G 63G 869G 7% /opt/hdata2
/dev/sdd1 xfs 932G 65G 867G 7% /opt/hdata3
/dev/sde1 xfs 932G 67G 866G 8% /opt/hdata4
#Hdfs的datanode⽬录磁盘是sdb、sdc、sdd和sde,也就是说hba存储在这四块磁盘上。总的⼤⼩⼤概是4T不到⼀点,4台设备的集群总⼤⼩⼤约在14.5T左右。
[root@node1~]# cat /proc/cpuinfo #24核
……………………
processor : 23
vendor_id : GenuineIntel
cpu family : 6
model : 62
model name : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
stepping : 4
microcode : 0x428
cpu MHz : 1211.109
cache size : 15360 KB
physical id : 1
siblings : 12
core id : 5
cpu cores : 6
apicid : 43
initial apicid : 43
fpu : yes
fpu_exception : yes
cpuid level : 13
儿童教育网
wp : yes
flags : fpu vme de p tsc msr pae mce cx8 apic p mtrr pge mca cmov pat p36 clflush dts acpi mmx fxsr s s2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ss3 cx16 xtpr pdcm pcid dca s4_1 s4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm arat epb pln pts dtherm
tpr_shadow vnmi flexpriority ept vpid fsgsba smep erms xsaveopt
bogomips : 4204.89
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
[root@node1 ~]# ethtool bond0 #⽹卡信息
Settings for bond0:
Supported ports: [ ]
Supported link modes: Not reported
Supported pau frame u: No
Supports auto-negotiation: No
Advertid link modes: Not reported
Advertid pau frame u: No
Advertid auto-negotiation: No
Speed: 2000Mb/s
Duplex: Full
Port: Other
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Link detected: yes盛行的意思
[root@node1 ~]# hadoop version #hadoop版本
Hadoop 2.7.1.2.4.2.0-258
Subversion :hortonworks/hadoop.git -r 13debf893a605e8a88df18a7d8d214f571e05289
Compiled by jenkins on 2016-04-25T05:46Z
Compiled with protoc 2.5.0
From source with checksum 2a2d95f05ec6c3ac547ed58cab713ac
This command was run using /usr/hdp/2.4.2.0-258/hadoop/hadoop-common-2.7.1.2.4.2.0-258.jar
[root@node1 ~]# hba version #hba版本
2016-09-06 14:52:19,070 INFO [main] util.VersionInfo: HBa 1.1.2.2.4.2.0-258
2016-09-06 14:52:19,071 INFO [main] util.VersionInfo: Source code repository file:///grid/0/jenkins/workspace/HDP-build-centos6/bigtop/build/hba/rpm/BUILD/hba-1.1.2.2.4.2.0 revision=Unknown
2016-09-06 14:52:19,071 INFO [main] util.VersionInfo: Compiled by jenkins on Mon Apr 25 06:36:21 UTC 2016
2016-09-06 14:52:19,071 INFO [main] util.VersionInfo: From source with checksum
4f661ee4f9f148ce7bfcad5b0d667c27
[root@node1 ~]# hdfs version #hdfs版本
Hadoop 2.7.1.2.4.2.0-258
Subversion :hortonworks/hadoop.git -r 13debf893a605e8a88df18a7d8d214f571e05289
Compiled by jenkins on 2016-04-25T05:46Z
Compiled with protoc 2.5.0
From source with checksum 2a2d95f05ec6c3ac547ed58cab713ac
This command was run using /usr/hdp/2.4.2.0-258/hadoop/hadoop-common-2.7.1.2.4.2.0-258.jar
Hadoop集群共有相同配置的4个node节点,在其他相同配置的集群以外的node节点上运⾏ycsb测试进程,hadoop集群是通过ambari软件运⾏维护的,对应的很多配置都是在ambari的web界⾯上去完成的。
2.2 hadoop配置
这⾥的hadoop配置主要包括了hba和hdfs两类配置,读写在具体配置时会有稍许不同,这个在具体的地⽅会具体指明。
在后⾯第4、5章中介绍读写配置时没有单独指出介绍的配置项⼀般在两种情况下都较为适⽤,⽽且⼏乎都已经调到了最⼤值,在这⾥会统⼀介绍。
2.2.1 hba配置
[root@node1 test]# cat /usr/hdp/current/hba-client/l
<configuration>
#Todo
名词性从句练习题<property>
<name>dfs.domain.socket.path</name>
<value>/var/lib/hadoop-hdfs/dn_socket</value>
</property>
#Todo
<property>
<name>hba.bulkload.staging.dir</name>
<value>/apps/hba/staging</value>
</property>
#每条记录的最⼤⼤⼩为1MB
<property>
<name>hba.client.keyvalue.maxsize</name>
<value>1048576</value>
</property>
#hba client操作失败重新请求数为35
<property>
benediction
<name>ies.number</name>
<value>35</value>
</property>
#当⼀次scan操作不在本地内存时,需要从disk中获取时,缓存的条数,这⾥设置为100000条,该值不能⼤于下⽂中
hba.client.scanner.timeout.period配置项的值
<property>
<name>hba.client.scanner.caching</name>
<value>100000</value>
</property>
潍坊日向友好学校下图中的第⼀个配置项hba.client.scanner.timeout.period对应的是上⽂中的Number of Fetched Rows when Scanning from Disk,它的值必须⼩于下图中的第⼀个配置项才⾏。
第⼆个配置项的话默认是true的,⽆需额外配置,之前在解决⼀个相关问题时,将它置为了fal。
tips
<property>
<name>hba.client.scanner.timeout.period</name>
<value>120000</value>
</property>
#hba是否配置为分布式
<property>
<name>hba.cluster.distributed</name>
北京雅思家教<value>true</value>
</property>
#Todo
<property>
<name&processor.master.class</name>
<value></value>
</property>
#Todo
<property>
<name&ion.class</name>
<value>org.apache.hadoop.hba.curity.access.SecureBulkLoadEndpoint</value>
</property>
#设置为ture,忽略对默认hba版本的检查(设置为fal的话在maven⼯程的编译过程中可能会遇到版本相关的问题)
<property>
<name>hba.defaults.for.version.skip</name>
<value>true</value>
疟子
</property>
#设置系统进⾏1次majorcompaction的启动周期,如果设置为0,则系统不会主动出发MC过程,默认为7天
<property>经典英语签名
<name>hba.hregion.majorcompaction</name>
<value>604800000</value>
</property>
#⽤来作为计算MC时间周期,与hba.hregion.majorcompaction相结合,计算出⼀个浮动的MC时间。默认是0.50,简单来说如果当前store中hfile的最早更新时间早于某个MCTime,就会触发major compaction,hba通过这种机制定期删除过期数据。MCTime是⼀个浮动值,浮动区间为[ hba.hregion.majorcompaction - hba.hregion.majorcompaction *
hba.hregion.majorcompaction.jitter , hba.hregion.majorcompaction + hba.hregion.majorcompaction *
hba.hregion.majorcompaction.jitter ]
<property>
<name>hba.hregion.majorcompaction.jitter</name>
<value>0.50</value>
</property>