(lightbulb goes off) Re: sockstat not working

Matthew Dillon dillon at apollo.backplane.com
Wed Feb 2 15:09:22 PST 2005


: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 at xxxxxxxxxxxxx>





More information about the Bugs mailing list