Flink 火焰图

Flink 自己也支持了 Task 粒度的 Flame Graphs 功能,并且可以细化到 subtask 粒度。

第一步:配置启用功能

Flink 作业动态参数里增加配置:"rest.flamegraph.enabled": "true" 并重启作业。当前该功能没有默认开启,因为这个功能使用时对性能有少量损耗,特别是对于并行度比较大的作业。

第二步: 在 Web UI 上选中想要探查的算子,打开 FlameGraph 面板

方式二 使用 Arthas 打印火焰图

第一步:通过 WebShell 查看 container 的 IP 和 PID第二步:下载 Arthas, 并绑定 container 的 PID 启动

bash 复制代码
# Godel/K8S 下默认打包了 arthas,可以直接使用
ls /opt/tiger/arthas/arthas-boot.jar
# 历史作业或者 yarn 环境下没有默认打包,可以主动下载 Arthas
curl -O https://arthas.aliyun.com/arthas-boot.jar

# 绑定 PID 启动
java -jar arthas-boot.jar ${PID}

第三步:使用 profiler 命令打印火焰图

bash 复制代码
[arthas@327]$ profiler start
Profiling started
[arthas@327]$  profiler stop
OK
profiler output file: /opt/tiger/workdir/arthas-output/20220822-180615.html
[arthas@327]$ exit

第四步:将火焰图文件移动至 Flink 日志目录下
第五步 在 Flink WebUI JM/TM 的 Log List 页面中找到火焰图文件并下载

相关推荐
大大大大晴天1 天前
Hudi技术内幕:RecordPayload到RecordMerger
大数据
SelectDB2 天前
秒级弹性、最高降本 70%:SelectDB Serverless 如何重塑云数仓资源效率
大数据·后端·云原生
WhoAmI2 天前
MapReduce框架原理解析一:InputFormat
大数据·hadoop
WhoAmI2 天前
MapReduce框架原理解析三:OutputFormat
大数据·hadoop
WhoAmI2 天前
MapReduce框架原理解析二:Shuffle
大数据·hadoop
大大大大晴天3 天前
Hudi技术内幕:Key Generation原理与实践
大数据
得物技术6 天前
从埋点需求到规则资产:Hermes Agent 重构得物数仓工作流
大数据·llm·ai编程
久美子6 天前
AI驱动数仓建设的Harness工程实践——本体建模、知识分层与上下文工程
大数据
大树887 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
大志哥1237 天前
ES和Logstash日志链路系统上线后遭遇切片爆炸(解决)
大数据·elasticsearch