From 0a9d4fa5043bd7291611c41588bdd3f0b70ede44 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Wed, 30 Mar 2022 13:27:55 -0400 Subject: [PATCH] 18941: Tweak the prefetch thread max to 7 Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- services/fuse/arvados_fuse/fusedir.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/fuse/arvados_fuse/fusedir.py b/services/fuse/arvados_fuse/fusedir.py index 876825a370..f3816c0d3e 100644 --- a/services/fuse/arvados_fuse/fusedir.py +++ b/services/fuse/arvados_fuse/fusedir.py @@ -525,9 +525,12 @@ class CollectionDirectory(CollectionDirectoryBase): self.collection.update() new_collection_record = self.collection.api_response() else: - # too much prefetch and you end up stepping on your own transfers - # experimentally the optimal somewhere between 4 and 6 - get_threads = min(max((self.api.keep.block_cache.cache_max // (64 * 1024 * 1024)) - 1, 1), 6) + # If there's too many prefetch threads and you + # max out the CPU, delivering data to the FUSE + # layer actually ends up being slower. + # Experimentally, capping 7 threads seems to + # be a sweet spot. + get_threads = min(max((self.api.keep.block_cache.cache_max // (64 * 1024 * 1024)) - 1, 1), 7) # Create a new collection object if uuid_pattern.match(self.collection_locator): coll_reader = arvados.collection.Collection( -- 2.30.2