-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Reduce thread congestion in HashBuilderOperator #22668
Reduce thread congestion in HashBuilderOperator #22668
Conversation
lib/trino-memory-context/src/main/java/io/trino/memory/context/ThresholdLocalMemoryContext.java
Outdated
Show resolved
Hide resolved
|
09d6720
to
11c0340
Compare
Memory management in HashBuilderOperator.addInput caused significant thread congestion. When memory tracking accuracy is traded for calling delegate.setBytes() less frequently, we are getting better performance for queries which tend to process tiny pages in HashBuilder operator.
11c0340
to
32941d5
Compare
updated |
public class ThresholdLocalMemoryContext | ||
implements LocalMemoryContext | ||
{ | ||
public static final long DEFAULT_SYNC_THRESHOLD = 65536; |
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.
somewhere (query context? driver context? don't remember) there is already a similar mechanism, with 1 MB threshold (AFAIR)
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.
There is some guaranteed memory somewhere - do you mean this one?
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.
Yeah - there is - but it is handled in the AggregatedMemoryContext in the synchronized section already here.
It is just to ensure we are reuturning non-blocked future. The accounting is still 100% correct - so it does not help with thread congestion.
CI: #18697 |
CI: #21736 |
Memory management in HashBuilderOperator.addInput caused significant
thread congestion. When memory tracking accuracy is traded for calling
delegate.setBytes() less frequently, we are getting better performance
for queries which tend to process tiny pages in HashBuilder operator.
Improvement is very much visible in couple TPC-DS queries run in FTE mode.
Queries run on unpartitioned iceberg, sf1000, 8 nodes cluseter.
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: