Comparison

mod_measure_process/mod_measure_process.lua @ 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
parent 4554:025cf93acfe9
child 4878:c26f515751af
comparison
equal deleted inserted replaced
4876:0f5f2d4475b9 4877:adc6241e5d16
65 open_fds:set(count) 65 open_fds:set(count)
66 66
67 if has_posix then 67 if has_posix then
68 local ok, soft, hard = posix.getrlimit("NOFILE") 68 local ok, soft, hard = posix.getrlimit("NOFILE")
69 if ok then 69 if ok then
70 max_fds:set(hard) 70 max_fds:set(soft or hard);
71 end 71 end
72 end 72 end
73 end); 73 end);
74 end 74 end