Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dcache-bulk: allow multi-threaded directory listing on expandDirectories
Motivation: In order to scale out bulk requests concurrency, the bulk service was redesigned to run each request in its own container. Each container uses a single thread with a reentrant semaphor but a thread pool to process the async Futures for each action performed. However, if there is directory listing (expandDirectories), this currently is done on the main thread depth-first. This turns out to be rather slow (only about 2K targets a minute, or ~33Hz). Depth-first ordering of the target ids, on the other hand, is only necessary for directory targets (e.g., on DELETE), which are then processed serially. Modification: Allow the depth-first expansion to be asynchronous and multithreaded (each directory given a separate threaded task). Since this means the strictly monotonic ordering of target ids is no longer the case, we also need to sort the directory targets (if any) that are deferred in memory by path depth. The container uses a BoundedCachedExecutor to handle the listing tasks, but the expansion method also looks at the current state of the thread queue, and only sends the directory task to the executor if there are idle threads; otherwise, it allows the directory to be listed (shallow) on the main thread. This permits a bit more concurrency and avoids total starvation of running requests. Result: Much improved performance (by about an order of magnitude), with the thread pool at about 20 (this is of course adjustable). `This patch is for master only, not just because it is an enhancement, but also because the current call for recursive request usage is low. Making this available in 9.2 seems to me reasonable.` Target: master Patch: https://rb.dcache.org/r/14041 Acked-by: Tigran
- Loading branch information
Showing
6 changed files
with
137 additions
and
54 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