From owner-freebsd-net@FreeBSD.ORG Thu Dec 25 20:23:42 2008 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40B3E1065673 for ; Thu, 25 Dec 2008 20:23:42 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from smtp-1.dlr.de (smtp-1.dlr.de [195.37.61.185]) by mx1.freebsd.org (Postfix) with ESMTP id CF9E98FC1A for ; Thu, 25 Dec 2008 20:23:41 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from [192.168.2.100] ([172.21.151.1]) by smtp-1.dlr.de with Microsoft SMTPSVC(6.0.3790.1830); Thu, 25 Dec 2008 21:10:24 +0100 Message-ID: <4953E89B.1060102@dlr.de> Date: Thu, 25 Dec 2008 21:10:03 +0100 From: Hartmut Brandt User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Eugene Grosbein References: <20081225193818.GA9210@svzserv.kemerovo.su> In-Reply-To: <20081225193818.GA9210@svzserv.kemerovo.su> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 25 Dec 2008 20:10:24.0532 (UTC) FILETIME=[D25B2540:01C966CC] Cc: net@freebsd.org Subject: Re: bsnmpd & BGP full view X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Dec 2008 20:23:42 -0000 Eugene Grosbein wrote: > Hi! > > Is there a way to reduce bsnmpd's CPU & memory usage > for BGP router using full view? > > I do not need to deal with routing table via SNMP. > SNMP is needed to monitor interface byte counters only via mrtg. > > bsnmpd grows upto 18Mb for FreeBSD 6.4 and worse, > it hogs CPU while bgpd obtains full view. > Hmm. I just had a look and the version in 6.4 already has the optimized route table (you may confirm that: contrib/bsnmp/snmp_mibII/mibII_route.c should include sys/tree.h). It takes 36 byte per route on a 32-bit machine and should take 52 byte on a 64-bit one. The only way to reduce memory consumption considerably that I can see is to use the kernel routing table directly, but this requires to implement the GETNEXT operation in kernel. In any case it should re-read the kernel table only every 10 minutes and in the mean time monitor the routing socket to update its copy of the table. If of course someone is doing a lot of updates on the kernel table it will receive all these changes and apply them to its copy of the routing table. If the latter is a problem you could disable the routing socket interface and could just rely on the 10 minute re-reads. Between these re-reads you would not see changes to the routing table through SNMP. BTW: how many routes do you have? When I introduced the optimized routing table I tested with 150k routes which was reported to be reasonable at that time. harti