You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my environment, about 1000000 close() syscalls produced by my own collector every 10 seconds. Almost takes 300ms when doing close FDs.
After analysis, I find the following reasons.
def _close_fds(self, but):
if hasattr(os, 'closerange'):
os.closerange(3, but)
os.closerange(but + 1, MAXFD)
else:
for i in xrange(3, MAXFD):
if i == but:
continue
try:
os.close(i)
except:
pass
In my environment, about 1000000
close()
syscalls produced by my own collector every 10 seconds. Almost takes 300ms when doing close FDs.After analysis, I find the following reasons.
close_fds=True
parameter insubprocess.Popen
.https://github.com/OpenTSDB/tcollector/blob/master/tcollector.py#L1372
/usr/lib/python2.7/subprocess.py
Also, after review the history patch, I find the patch which set
close_fds
fromFalse
toTrue
. 7b5659d#diff-50bd42e8d38bbdf7c24f69ae5e25165f @tsunaAny good idea to solve to this?
The text was updated successfully, but these errors were encountered: