-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Enhancement] reduce mem alloc failed because unfair memory sharing (backport #50686) #50752
Conversation
…50686) Signed-off-by: yanz <[email protected]> (cherry picked from commit 15a6518) # Conflicts: # be/src/connector/connector.h # be/src/exec/pipeline/fragment_executor.cpp # gensrc/thrift/InternalService.thrift
Cherry-pick of 15a6518 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr |
-e Signed-off-by: yanz <[email protected]>
Quality Gate passedIssues Measures |
Why I'm doing:
One problem with tpch sf100 Q21 is that the performance is very unstable, if you look at the logs you can see that there are a lot of mem alloc failed cases inside scan node 8
If you analyze the logs, you can observe that most of the memory is allocated by nodes 0,2,5. This leads to a problem that node 8 has almost no way to get memory: (my memory is 64G, scan_mem_ratio=0.3, then at most 15G memory is allocated to connector scan ndoe)
The root cause of this problem is the connector mem arbitrator implementation. The original intent of this implementation was to be able to average memory between each node. The algorithm is as follows:
Each node starts with
update_chunk_source_mem_bytes(0, mem)
. But the problem with this is that for the very first node, it uses up all the memory. And it causes all the following nodes to not get any memory.What I'm doing:
So the fix here is to
update_chunk_source_mem_bytes(256M, mem)
benchmark
After the modification, the execution time can be stabilized at 9s
If more memory is given, then the time can be reduced even further
Here you can compare the effect of turning off the adaptive effect, the time difference is not much.
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check:
This is an automatic backport of pull request #50686 done by [Mergify](https://mergify.com). ## Why I'm doing:
One problem with tpch sf100 Q21 is that the performance is very unstable, if you look at the logs you can see that there are a lot of mem alloc failed cases inside scan node 8
If you analyze the logs, you can observe that most of the memory is allocated by nodes 0,2,5. This leads to a problem that node 8 has almost no way to get memory: (my memory is 64G, scan_mem_ratio=0.3, then at most 15G memory is allocated to connector scan ndoe)
The root cause of this problem is the connector mem arbitrator implementation. The original intent of this implementation was to be able to average memory between each node. The algorithm is as follows:
Each node starts with
update_chunk_source_mem_bytes(0, mem)
. But the problem with this is that for the very first node, it uses up all the memory. And it causes all the following nodes to not get any memory.What I'm doing:
So the fix here is to
update_chunk_source_mem_bytes(256M, mem)
benchmark
After the modification, the execution time can be stabilized at 9s
If more memory is given, then the time can be reduced even further
Here you can compare the effect of turning off the adaptive effect, the time difference is not much.
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist: