X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/67e56f190b9a78e3c45cc7d90510fc631e0d04b6..74fec3cd8284eae4829dad2c287588d52c621c4b:/services/fuse/arvados_fuse/command.py diff --git a/services/fuse/arvados_fuse/command.py b/services/fuse/arvados_fuse/command.py index 994c998823..e275825a61 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,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() @@ -227,7 +237,9 @@ class Mount(object): disk_cache=self.args.disk_cache, disk_cache_dir=self.args.disk_cache_dir), 'num_retries': self.args.retries, - }) + }, + version='v1', + ) except KeyError as e: self.logger.error("Missing environment: %s", e) exit(1)