Re: (lightbulb goes off) Re: sockstat not working
:Ouch. Yeah, we would have to iterate over the filedesc structures and
:multiply the reference count there with f_count of the file. But we
:can't do that easily and have to iterate over the processes instead.
:Which means a multi-threaded webserver kills the *stat performance
:just for the counting.
:
:Joerg
If you want you can clean it up some more... instead of having it
iterate through fd_nfiles in the NULL case you could simply
do count += fdo->fd_nfiles, but if you do that make sure fd_nfiles
is some reasonable value (< 500), otherwise sparse descriptor sets
may balloon the number too high.
-Matt
Matthew Dillon
<dillon@backplane.com>
討論串 (同標題文章)
完整討論串 (本文為第 3 之 4 篇):