18790: Add upgrade note re WebDAV.InternalURLs.
[arvados.git] / services / fuse / arvados_fuse / command.py
index 8cb0a0601b39044f4e8e3cd2c3118da5e055580f..e275825a6109126b15dca1941a55b306ba98b8b9 100644 (file)
@@ -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,15 @@ 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.setrlimit(resource.RLIMIT_NOFILE, (min(10240, nofile_limit[1]), nofile_limit[1]))
+        except Exception as e:
+            self.logger.warning("arv-mount: unable to adjust file handle limit: %s", e)
+
+        self.logger.debug("arv-mount: file handle limit is %s", resource.getrlimit(resource.RLIMIT_NOFILE))
+
         try:
             self._setup_logging()
             self._setup_api()