On Wed, Jul 03, 2019 at 09:44:41AM +0100, Daniel P. Berrangé wrote:
On Wed, Jul 03, 2019 at 09:19:17AM +0200, Michal Privoznik wrote:
> If the limit for max opened files is way bigger than the default (1024),
> say 3 orders bigger then spawning a child through virCommand can be
> expensive because we iterate over ALL FDs within the limit and close
> them. There's no need to that since we can learn the list of opened FDs
> from /proc/self/fd/.
Yeah I've seen this in docker containers in particular where the
nfiles limit is something like 2 million.
Hopefully Linux will finally get something equiv to BSD's closefrom()
syscall we can use in the future:
https://lwn.net/Articles/593778/