Add recording distribution of outputBuffer utilization#13463
Conversation
skrzypo987
left a comment
There was a problem hiding this comment.
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
sopel39
left a comment
There was a problem hiding this comment.
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
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
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
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
Outdated
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
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
sopel39
left a comment
There was a problem hiding this comment.
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
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java
Outdated
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
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/OutputBufferInfo.java
Outdated
Show resolved
Hide resolved
d5e5c56 to
d9b5d25
Compare
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.utilizationparameter in the operator stats.