[arvados] updated: 2.1.0-3180-g6cb6d4343

git repository hosting git at public.arvados.org
Thu Dec 15 18:14:36 UTC 2022


Summary of changes:
 sdk/python/arvados/keep.py            | 16 ++++++++++------
 services/fuse/arvados_fuse/command.py |  8 ++++++++
 2 files changed, 18 insertions(+), 6 deletions(-)

       via  6cb6d4343e0d80e84e46b1e4f11a7cb2f0e06fd9 (commit)
      from  c71a52a28c9cee6511172b3130cf74e8df1b4950 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 6cb6d4343e0d80e84e46b1e4f11a7cb2f0e06fd9
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Thu Dec 15 13:14:02 2022 -0500

    19872: Use fewer file handles by default, but increase the limit in arv-mount
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index f0ccf85d7..cbe96ffa2 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -198,14 +198,18 @@ class KeepBlockCache(object):
                 # open it initially and hold the flock(), and a second
                 # hidden one used by mmap().
                 #
-                # Set max slots to 3/8 of maximum file handles.  This
-                # means we'll use at most 3/4 of total file handles.
+                # Set max slots to 1/8 of maximum file handles.  This
+                # means we'll use at most 1/4 of total file handles.
                 #
                 # NOFILE typically defaults to 1024 on Linux so this
-                # is 384 slots (768 file handles), which means we can
-                # cache up to 24 GiB of 64 MiB blocks.  This leaves
-                # 256 file handles for sockets and other stuff.
-                self._max_slots = int((resource.getrlimit(resource.RLIMIT_NOFILE)[0] * 3) / 8)
+                # is 128 slots (256 file handles), which means we can
+                # cache up to 8 GiB of 64 MiB blocks.  This leaves
+                # 768 file handles for sockets and other stuff.
+                #
+                # When we want the ability to have more cache (e.g. in
+                # arv-mount) we'll increase rlimit before calling
+                # this.
+                self._max_slots = int(resource.getrlimit(resource.RLIMIT_NOFILE)[0] / 8)
             else:
                 # RAM cache slots
                 self._max_slots = 512
diff --git a/services/fuse/arvados_fuse/command.py b/services/fuse/arvados_fuse/command.py
index 8cb0a0601..e232b65ec 100644
--- a/services/fuse/arvados_fuse/command.py
+++ b/services/fuse/arvados_fuse/command.py
@@ -16,6 +16,7 @@ import signal
 import subprocess
 import sys
 import time
+import resource
 
 import arvados.commands._util as arv_cmd
 from arvados_fuse import crunchstat
@@ -133,6 +134,13 @@ class Mount(object):
         if self.args.logfile:
             self.args.logfile = os.path.realpath(self.args.logfile)
 
+        try:
+            nofile_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
+            if nofile_limit[0] < 10240:
+                resource.getslimit(resource.RLIMIT_NOFILE, min(10240, nofile_limit[1]))
+        except Exception as e:
+            self.logger.warning("arv-mount: unable to adjust file handle limit: %s", e)
+
         try:
             self._setup_logging()
             self._setup_api()

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list