Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用以下命令设置可能打开的文件的新限制:
import resource resource.setrlimit(RLIMIT_NOFILE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY))
但是,我收到一个错误:ValueError: current limit exceeds maximum limit 有什么办法可以克服这个问题并对 OS X 设置新的限制?
ValueError: current limit exceeds maximum limit
你只能在 Mac os 中这样做。
import resource target_procs = 10240 your_procs = ??? real_procs = min(target_procs, your_procs) resource.setrlimit(RLIMIT_NOFILE, real_procs, resource.RLIM_INFINITY))
参考是https://github.com/chapmanb/bcbio-nextgen/commit/0f590e12854df466053fcbfa590ab4ce9d7b9c45#diff-56930ee326340a3ab74bf8a0368e2d55