forked from facebookincubator/velox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parallelize local memory arbitration (facebookincubator#9649)
Summary: Parallelize the local memory arbitration execution. The workload flow of memory arbitration process changes as follows: First wait in the arbitration queue to serialize the memory arbitration request processing from the same query pool. Adds ArbitrationQueue data structure for this which contains the wait promises of the arbitration requests from the same query pool. The arbitration queue is protected by arbitrator lock. Second calls runLocalArbitration to run local arbitration which acquires the reader lock of arbitration lock (which is added by this pr for local/global arbitration execution control). Then it ensures the request memory pool is within the capacity limit (this might trigger spill to reclaim the used memory from the request pool itself), and tries to allocate free capacity from the arbitrator or reclaim the free memory from the other queries which is protected by arbitrator lock. Third if runLocalArbitration can't reclaim sufficient memory, then proceeds with runGlobalArbitration which acquires the writer lock of arbitration lock. Then it reclaims the free capacity from the arbitrator or the other queries. And at last reclaims the used memory from the other queries by spilling. ArbitrationOperation is added to contains the state of arbitration request processing to simplify the code implementation. This PR also adds an option to disable global arbitration and only do local arbitration which can always run in parallel. With this option, for 2hrs stress test (1000 query concurrency at coordinator) with Meta internal production workloads replay, the averaged query execution time has been reduced by ~30% and cpu time is kept the same. The memory arbitration wall time for query without triggering spilled is only 9 mins in total. Pull Request resolved: facebookincubator#9649 Reviewed By: tanjialiang, oerling Differential Revision: D56685200 Pulled By: xiaoxmeng fbshipit-source-id: f8db71e4cae05f24f913464c37c5bc1e6528083b
- Loading branch information
1 parent
ec4d2ec
commit 5911129
Showing
16 changed files
with
1,401 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.