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'
--- 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);