| Facter is slow if nofile ulimit is set to big values like 5000000. E.g.:
- ulimit -n 65536
- time facter networking > /dev/null
real 0m0.396s user 0m0.200s sys 0m0.196s
- ulimit -n 6553600
- time facter networking > /dev/null
real 0m28.003s user 0m12.812s sys 0m15.190s
The problem is in https://github.com/puppetlabs/leatherman/blob/master/execution/src/posix/execution.cc#L318, leatherman closes all descriptors from stderr to max open file limit before execve (for running ip link or other command) and it takes about 3-4 seconds for 10M descriptors every time when it executes any binary. We use OS Ubuntu 18.04, puppet 6.1.0, facter 3.12.2. |