# HG changeset patch # User Kim Alvefur # Date 1642528520 -3600 # Node ID adc6241e5d1625f50734577c16eab2715bebfe02 # Parent 0f5f2d4475b9ef2b3fd3d21cc6ed4403c72f33f8 mod_measure_process: Report the enforced limit The soft limit is what the kernel actually enforces, while the hard limit is is how far you can change the soft limit without privileges. Unless the process dynamically adjusts the soft limit, knowing the hard limit is not as useful as knowing the soft limit. Reporting the soft limit and the number of in-use FDs allows placing alerts on expressions like 'process_open_fds / process_max_fds >= 0.95' diff -r 0f5f2d4475b9 -r adc6241e5d16 mod_measure_process/mod_measure_process.lua --- a/mod_measure_process/mod_measure_process.lua Tue Jan 18 17:01:18 2022 +0000 +++ b/mod_measure_process/mod_measure_process.lua Tue Jan 18 18:55:20 2022 +0100 @@ -67,7 +67,7 @@ if has_posix then local ok, soft, hard = posix.getrlimit("NOFILE") if ok then - max_fds:set(hard) + max_fds:set(soft or hard); end end end);