【Flink】第二十二篇:一文终结 Flink 内存配置
内存配置本质上是对进程规划合理的内存空间:
避免内存不足影响正常运行
减少内存资源浪费
在保证程序能够正常运行的前提下,为公司带来尽可能大的硬件资产价值。
本篇为大家肝了几张图,尽量使得内存配置不再抽象。
TaskManager
JobManager
内存解释
内存配置实战
JobManager
run -m yarn-cluster -ynm {yarn-app-name} -ys 1 -yjm 512m -ytm 1g -yd \
-yD jobmanager.memory.heap.size=224m \
-yD jobmanager.memory.enable-jvm-direct-memory-limit=true \
-yD jobmanager.memory.off-heap.size=64m \
-yD jobmanager.memory.jvm-metaspace.size=96m \
-yD jobmanager.memory.jvm-overhead.min=128m \
-yD jobmanager.memory.jvm-overhead.max=128m \
{flink-app}.jar
效果:
TaskManager
run -m yarn-cluster -ynm {yarn-app-name} -ys 1 -yjm 1g -ytm 1g -yd \
-yD taskmanager.memory.framework.heap.size=128m \
-yD taskmanager.memory.task.heap.size=128m \
-yD taskmanager.memory.managed.size=64m \
-yD taskmanager.memory.framework.off-heap.size=128m \
-yD taskmanager.memory.task.off-heap.size=128m \
-yD taskmanager.memory.network.min=64m \
-yD taskmanager.memory.network.max=64m \
-yD taskmanager.memory.jvm-metaspace.size=256m \
-yD taskmanager.memory.jvm-overhead.min=128m \
-yD taskmanager.memory.jvm-overhead.max=128m \
{flink-app}.jar
效果:
基本规则:
max min是硬性指标,fraction是软性指标且优先级低
overhead优先级较低,算法较为弹性