Re: [PATCH 0/3] Optimize mass closing of FDs on child spwaning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

meanwhile relying on /proc is reasonable I guess. The extra syscalls
to read the dir should be balanced by fewer close syscalls quite
easily.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux