system
pykmhelpers.core.system
Helpers for inspecting and adjusting process resource limits (ulimits).
get_ulimit(resource_type=resource.RLIMIT_NOFILE)
get_available_ram(safety_margin=0.9)
Return usable RAM in bytes: currently available memory scaled down by safety_margin.
get_available_threads(safety_margin=0.9)
Return a safe thread count: os.cpu_count() scaled down by safety_margin.
get_max_open_files(safety_margin=0.9)
Return a safe open-files ceiling: the soft RLIMIT_NOFILE scaled down by safety_margin.
maximize_nofile()
Raise the open-files (RLIMIT_NOFILE) limit to the highest allowed value.