changeset 4877:adc6241e5d16

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'
author Kim Alvefur <zash@zash.se>
date Tue, 18 Jan 2022 18:55:20 +0100
parents 0f5f2d4475b9
children c26f515751af
files mod_measure_process/mod_measure_process.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);