-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add recording distribution of outputBuffer utilization #13463
Add recording distribution of outputBuffer utilization #13463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that a lot of code is copied between the *OutputBuffer classes, including the new code introduced in this commit. Please take a look if there is a chance to deduplicate some of it.
core/trino-main/src/main/java/io/trino/operator/TableWriterOperator.java
Outdated
Show resolved
Hide resolved
7b6875c
to
cd44061
Compare
@skrzypo987 , that's true. However, that pull request just adds measuring the output buffer utilization and it just adds the field to store state, the update of the state and the exposition of the state. I think it is not too much and it is very readable. Obviously, we could add a super class but on my eye it is not a good idea here to separate out the abstract class only for stats. Sometimes it is better to have duplicated code for readability and to diminish complexity, I think so at least. |
core/trino-main/src/main/java/io/trino/execution/buffer/PartitionedOutputBuffer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferInfo.java
Outdated
Show resolved
Hide resolved
6ed60bd
to
d41bf05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you manually checked that stats are there?
core/trino-main/src/main/java/io/trino/operator/output/TaskOutputOperator.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/operator/OperatorInfo.java
Outdated
Show resolved
Hide resolved
@sopel39 , it was hard to me to catch the difference. I've run query
We see the difference between smaller and bigger Before we merge I need to wait for benchmark results. |
2ae0830
to
d938757
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % comments
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBuffer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/LazyOutputBuffer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/SpoolingExchangeOutputBuffer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/operator/output/TaskOutputOperator.java
Outdated
Show resolved
Hide resolved
d938757
to
5b9bece
Compare
@sopel39 , |
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/operator/output/PagePartitioner.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/operator/output/TaskOutputOperator.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Show resolved
Hide resolved
ee6a954
to
1a37705
Compare
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Show resolved
Hide resolved
1a37705
to
7fbd00c
Compare
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/PartitionedOutputBuffer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
afd266c
to
787127d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % comments.
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
CI are failing |
f1d033d
to
e35f0ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % comments.
- How do you extract histogram for query?
- Is lock conjestion not a problem (how fast is
TDigest.copyOf(bufferUtilization)
)?
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferInfo.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Show resolved
Hide resolved
@sopel39 ,
Just by downloading the JSON with stats
It does not look like (basing on JFR profile) |
e35f0ed
to
4b20fbe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % comment
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferInfo.java
Show resolved
Hide resolved
d5e5c56
to
d9b5d25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind compilation errors
core/trino-main/src/main/java/io/trino/execution/StageStateMachine.java
Outdated
Show resolved
Hide resolved
a413907
to
7d495ef
Compare
Add outputBufferUtilization field to the OutputBufferInfo to expose distribution of output buffer utilization.
7d495ef
to
c3fe23f
Compare
Could you paste example utilization report for query where source stage is/isn't a bottleneck? |
@sopel39 , shared offline |
This pull request adds the exposure of the distribution of
outputBuffer
's utilization as theoutputBuffers.utilization
parameter in the operator stats.