getifaddrs() scalability

Max Laier max at love2party.net
Sat Apr 5 16:52:59 UTC 2008


On Saturday 05 April 2008 16:37:04 Bruce M Simpson wrote:
> Just off the top of my head...
> ...has anyone run into problems with the scalability of this call?
>
> One of the XORP users needs to create »1000 interfaces in Linux, and
> I'm wondering if any FreeBSD users need to create that amount of
> network interfaces.
>
> As such the getifaddrs() call is likely to get slow in that scenario,
> as it uses a linked list.

I'm not sure what you are trying to achieve.  getifaddrs is the API to get 
a complete and consistent snapshot of all currently configured addresses 
and I don't think there is a better way to represent that then a linked 
list.  If you need to do lookups in userland you should build your own 
data structure off of that list.  You can use a PF_ROUTE socket to watch 
for changes and modify your view accordingly.

-- 
/"\  Best regards,                      | mlaier at freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier at EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News


More information about the freebsd-net mailing list