varnish-cache
varnish-cache copied to clipboard
varnishtest: Fork and clean up FD table before running tests
This PR is a follow-up to #3887. It does two things:
- On systems without the
closefromsyscall, we now iterate through/proc/<PID>/fd/and individually close each FD. - The main
varnishtestprocess is now forked, and the FD table is cleaned up, before we start forking out test processes.
The main motivation for these changes is that we have seen big performance gains by reducing the number of file descriptors each test process has to close, especially in CPU constrained environments.
VDD: Keep the VSUB_closefrom() change only, we should not need to fork once again. OK to merge.
Dropped the fork change and added a note to the varnishtest documentation.