def raise_file_descriptor_limit():
    _, hard_nofile = resource.getrlimit(resource.RLIMIT_NOFILE)
    nofile_target = hard_nofile
    if os.geteuid() == 0:
        nofile_target = 1024 * 64
    # Now bump up max filedescriptor limit as high as possible
    while True:
        try:
            hard_nofile = nofile_target
            resource.setrlimit(resource.RLIMIT_NOFILE,
                               (nofile_target, hard_nofile))
        except __HOLE__:
            nofile_target /= 1024
        break
dataset/ETHPy150Open swiftstack/ssbench/ssbench/util.py/raise_file_descriptor_limit