当前位置:网站首页>Flame diagram analysis Flink backpressure
Flame diagram analysis Flink backpressure
2022-07-26 06:57:00 【wending-Y】
List of articles
The phenomenon
team A new version Flink Homework , There are modifications in the old homework , Make the final verification findings before publishing ,Fliink There is backpressure in operation , Some operators report red , see topic The consumer group has lag
analysis
The phenomenon at that time is similar to the following figure , The last dot shows busy max 100%
guess 1
Data skew
The degree of parallelism is 3, Look at each task The amount of data processed is relatively uniform
guess 2
It takes a long time to call the external interface
Use arthas trace Interface discovery takes time 20ms about
guess 3
taskmanager Nodes are frequent GC , Cause a pause
see task node GC The frequency and time consumption are normal
guess 4, Confirm code changes
Confirm that the code changes very little ? It shouldn't be a code problem
reflection
A few hatchets come down , I still don't see the problem
Big recruit ( Flame chart )
Adjust configuration , Open the flame diagram
rest.flamegraph.enabled : true
On-cpu
see On-cpu The flame diagram is similar to the following 
off-cpu chart

analysis
There is no lock related , So don't think about off-cpu
from on-cpu Look at , It shows that most of the homework cpu They're all carrying out socket Code
I didn't pay attention here at that time , Later, I found that I shouldn't have much time to execute this code , As for why it can be adjusted socket , From top to bottom, it is because the program adjusts an external http Interface .
The frequency of normal logic interface should not be very high , It indicates that there is a problem with the code change , Confirm again that there is a problem with the code change , After repairing the code and going online again , The task is normal , either lag, Always solve .
Flame chart
Flame diagram example code
public class HotTest {
public static void main(String[] args) {
run();
}
private static void run() {
runA();
runB();
}
private static void runB() {
for (int i = 0; i < 300000; i++) {
System.out.println("this is b");
}
}
public static void runA() {
runC();
for (int i = 0; i < 500000; i++) {
System.out.println("this is a");
}
}
private static void runC() {
for (int i = 0; i < 200000; i++) {
System.out.println("this is c");
}
}
}
idea On the implementation 
Generate flame chart

How to see
y Depth of axis code function call
x The axis width represents the number of function samples , It can be simple and time-consuming
From the flame diagram
run Function takes time =runA()+runB()
runA Function takes time =runC()+ Print
So although this picture looks very complicated , When analyzing problems , Just look at the width of all the top-level functions , Then find it from top to bottom according to the widest function , Which business is executing this , Analysis is enough
Back to the beginning
Most of cpu They're all carrying out socket Code ,socket The code is caused by frequent interface calls , Finally, I found that there was a problem here, which led to .
summary
Flame diagram is used in analyzing performance scenarios , Confirmation is very convenient , We should strengthen our study in this field in the future .
边栏推荐
- Is there any online account opening process of Huatai Securities? Is online account opening safe
- Open includeexceptiondetailinfaults on the server (from servicebehaviorattribute or from & lt; servicedebug & gt; to configure behavior) to send exception information back
- buuReserve(4)
- Leetcode question brushing 1: topic classification
- 28. Implement strStr()实现 strStr()
- "XXXX" is running, which may cause the system to jam, reduce the standby time, and click Close "
- Binary tree knowledge summary
- 优炫数据库JDBC打开日志方式有哪些
- 『牛客|每日一题』模板栈
- 数据库性能测试(mysql)
猜你喜欢

Introduce you to JVM from architecture

微信小程序 - 从入门到入土

Delete ^m from VIM

Torth file read vulnerability (cnvd-2020-27769)
![[untitled] reprint](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled] reprint

Valid bracket sequence of "Niuke | daily question"

LeetCode刷题1:题目分类

buuReserve(4)
![Esxi 7.0 installation supports mellanox technologies mt26448 [connectx en 10gige, PCIe 2.0 5gt/s] driver, and supports the cheapest 10GB dual fiber network card](/img/51/a5282b657b1dfed2dac476c1efee2d.png)
Esxi 7.0 installation supports mellanox technologies mt26448 [connectx en 10gige, PCIe 2.0 5gt/s] driver, and supports the cheapest 10GB dual fiber network card

Summarize and learn STM32 to create project template
随机推荐
解决 Chrome 浏览器被毒霸篡改问题
III Actual combat - current time representation and world standard time format
敏捷整洁之道
Is the passenger flow always low? There is something wrong with the location of your store!
MySql 执行计划
源代码加密技术发展阶段
<二> objectARX开发:创建和编辑基本图形对象
常用的cmd指令
Integrated design of signal processing systems - Design of solver functions (continuous and discrete time systems)
How does the national standard gb28181 protocol easygbs platform realize device video recording and set streaming IP?
28. Implement strStr()实现 strStr()
Summary of common usage of dev treelist
从Architecture带你认识JVM
优炫数据库JDBC打开日志方式有哪些
[hard ten treasures] - 7.2 [dynamic RAM] analysis of the difference between DDR4 and DDR3
"Harmonyos" explore harmonyos applications
『牛客|每日一题』模板栈
Function of hot air pad
Fastdfs supports dual IP and IPv6
Differences and relations between varchar and nvarchar in database