hadoop的yarn容器、内存、vcore设计


一、container容器


容器 虚拟化的 维度 memory+vcore
运行task任务
生产如何调优Container参数?
假设128G 16物理core
1.1装完CentOS,消耗内存1G
1.2系统预览15%-20%内存(包含1.1),
以防全部使用导致系统夯住 和 oom机制事件,
或者给未来部署组件预览点空间
128*20%=25.6G ==26G
1.3假设只有DN NM节点,余下内存 128-26=102g
1.3.1 DN=2G
NM=4G

102-2-4=96G


1.3.2 container内存
yarn.nodemanager.resource.memory-mb 96G
yarn.scheduler.minimum-allocation-mb 1G 极限情况下,只有96个container 内存1G
yarn.scheduler.maximum-allocation-mb 96G 极限情况下,只有1个container 内存96G

container的内存会自动增加,默认1g递增
container:1-96个
1.3.3 container虚拟核
物理核:虚拟核 =1:2 32vcore
yarn.nodemanager.resource.pcores-vcores-multiplier 2

yarn.nodemanager.resource.cpu-vcores 32
yarn.scheduler.minimum-allocation-vcores 1 极限情况下,只有32个container
yarn.scheduler.maximum-allocation-vcores 32 极限情况下,只有1个container
container:1-32个
1.3.4 官方建议
cloudera公司推荐,一个container的vcore最好不要超过5,那么我们设置4

yarn.scheduler.maximum-allocation-vcores 4 极限情况下,只有8个container

1.3.5 综合memory+vcore
确定 vcore=4 container 8个

yarn.nodemanager.resource.memory-mb 96G
yarn.scheduler.minimum-allocation-mb 1G
yarn.scheduler.maximum-allocation-mb 12G 极限container 8个
当然当spark计算时内存不够大,这个参数肯定要调大,
那么这种理想化的设置个数必然要打破,以memory为主
yarn.nodemanager.resource.cpu-vcores 32
yarn.scheduler.minimum-allocation-vcores 1
yarn.scheduler.maximum-allocation-vcores 4 极限container 8个

8个container 12G 4vcore

yarn.nodemanager.resource.memory-mb 96G
yarn.scheduler.minimum-allocation-mb 1G
yarn.scheduler.maximum-allocation-mb 8G
12container 12*2=24

yarn.nodemanager.resource.cpu-vcores 32
yarn.scheduler.minimum-allocation-vcores 1
yarn.scheduler.maximum-allocation-vcores 2
16 container*8g

案例


假如 256G内存 56core,请问参数如何设置
假如该节点还有组件,比如hbase regionserver进程,那么该如何设置?
hbase regionserver = 30G DN=4G NN=2G
分析:预留10-20%作为系统内存 256*20%=51.2
256-2-4-52-30=168G
根据vcore来分
根据cloudera公司推荐,一个container的vcore最好不要超过5,那么我们设置4
由物理核:虚拟核 =1:2 112vcore
yarn.nodemanager.resource.cpu-vcores 112
yarn.scheduler.minimum-allocation-vcores 1
yarn.scheduler.maximum-allocation-vcores 4 极限container 28个

yarn.nodemanager.resource.memory-mb 168G
yarn.scheduler.minimum-allocation-mb 1G
yarn.scheduler.maximum-allocation-mb 6G 极限container 28个
vcore

yarn自己引入的
设计初衷是考虑不同节点的CPU的性能不一样,每个CPU的计算能力不一样。
比如某个物理CPU是另外一个物理CPU的2倍,这时通过设置第一个物理CPU的虚拟core
来弥补这种差异。
第一台机器 强悍 pcore: vcore=1:2
第二台机器 不强悍 pcore: vcore=1:1
xml配置
所有节点 pcore: vcore=1:2
————————————————
版权声明:本文为CSDN博主「pxj_pxj_pxj」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/xwcj3/article/details/103536696

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值