From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 8 18:19:39 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB768F98; Fri, 8 Mar 2013 18:19:39 +0000 (UTC) (envelope-from freebsd-lists@be-well.ilk.org) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id 93BEBCC9; Fri, 8 Mar 2013 18:19:39 +0000 (UTC) Received: from lowell-desk.lan (lowell-desk.lan [172.30.250.41]) by be-well.ilk.org (Postfix) with ESMTP id 91A1E33C1D; Fri, 8 Mar 2013 13:06:18 -0500 (EST) Received: by lowell-desk.lan (Postfix, from userid 1147) id E0B0439841; Fri, 8 Mar 2013 13:06:16 -0500 (EST) From: Lowell Gilbert To: Subject: Re: lots of network interfaces References: <031201ce1b91$841b90d0$8c52b270$@freebsd.org> Date: Fri, 08 Mar 2013 13:06:16 -0500 In-Reply-To: <031201ce1b91$841b90d0$8c52b270$@freebsd.org> (dteske@freebsd.org's message of "Thu, 7 Mar 2013 16:11:37 -0800") Message-ID: <44y5dx3gx3.fsf@lowell-desk.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: 'Wojciech Puchar' , devin.teske@fisglobal.com, freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: freebsd-hackers@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 18:19:39 -0000 writes: > I decided to stress-test the netgraph(4) subsystem one day and was able to > create 65530 interfaces before it produced an error, refusing to create another. > > At that point, the system was still usable, but... > > It took over an hour for ifconfig to list all the interfaces. Simply typing > "ifconfig" with no arguments and pressing ENTER would start spewing information > on-screen for over an hour before it finished. (so I'd say that there could be > some optimizations made; but nonetheless impressive that the system was still > very usable at that point, ifconfig aside). The interfaces are a linked list, plus there's a separate kernel dive for each interface. The list (as opposed to individual interfaces) is really only accessed from userland, so optimizing these operations would need a really good use case to be worthwhile. The current implementation is not just very well known, it's good for hundreds to thousands of interfaces..For the output of ifconfig alone, it might be possible to grab more information in the original getifaddrs() (which makes a copy of the interface list), but that would make other operations with that function more expensive.