18941: FUSE set number of get threads based on cache size
[arvados.git] / services / fuse / arvados_fuse / fusedir.py
index 7de95a0cb1b0d95bd1d67dcc58b5a3c406a863ff..bea7ed18c4fc4642e7c329f3245d093c688ff415 100644 (file)
@@ -529,11 +529,14 @@ class CollectionDirectory(CollectionDirectoryBase):
                         if uuid_pattern.match(self.collection_locator):
                             coll_reader = arvados.collection.Collection(
                                 self.collection_locator, self.api, self.api.keep,
-                                num_retries=self.num_retries)
+                                num_retries=self.num_retries,
+                                get_threads=(self.api.keep.block_cache.cache_max // 64 * 1024 * 1024)                            )
                         else:
                             coll_reader = arvados.collection.CollectionReader(
                                 self.collection_locator, self.api, self.api.keep,
-                                num_retries=self.num_retries)
+                                num_retries=self.num_retries,
+                                get_threads=(self.api.keep.block_cache.cache_max // 64 * 1024 * 1024)
+                            )
                         new_collection_record = coll_reader.api_response() or {}
                         # If the Collection only exists in Keep, there will be no API
                         # response.  Fill in the fields we need.