Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Nov 2008 21:25:09 -0800
From:      Julian Elischer <julian@elischer.org>
To:        Mykel <Mykel@mWare.ca>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Determining counts or size of routing table?	(netstat	performance?)
Message-ID:  <493223B5.7080502@elischer.org>
In-Reply-To: <49321FF8.6000805@mWare.ca>
References:  <4931A5B6.1060000@mWare.ca> <49321494.90706@elischer.org>	<49321EE2.6020001@freebsd.org> <49321FF8.6000805@mWare.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
Mykel wrote:
> Sam Leffler wrote:
>> Julian Elischer wrote:
>>> Mykel wrote:
>>>> Got a few 6.x machines running OpenBGPd with a few BGP full-feeds and a
>>>> handful of peers... I'd like to determine the size of the FIB/kernel
>>>> routing table. OpenBGPd does not give me this data, and on my
>>>> duallie-Xeon 2.8s, it takes quite a while to use netstat & wc to count.
>>>>
>>>> I'm not looking for exact numbers, just something I can poll via
>>>> NetSNMP
>>>> and plot in cacti...
>>>>
>>>> I looked though netstat, route, sysctl, vmstat, even pored over an
>>>> snmpwalk... can't find anything.
>>>> Been asking around, and the only suggestion I've received was to
>>>> write a
>>>> daemon that dumps the table and then monitors the changes, but I'm
>>>> not a
>>>> programmer, nor could I find any tool in ports that might assist in
>>>> this.
>>>>
>>>> I'd be happy with almost any metric that gives me some absolute
>>>> reference as to how big my routing table is so I can get some nice
>>>> pretty graphs done up. Not pounding the system every 60-300 seconds
>>>> would be very nice.
>>>>
>>>> Any suggestions? Or does everyone just pipe netstat? Is there a MIB for
>>>> sysctl or NetSNMP I'm missing?
>>>>
>>> no. It's a hard thing to do so that is why it hasn't been done yet.
>> Perhaps I misunderstand his question but
>>
>> trouble% vmstat -m  |grep routetbl
>>     routetbl    14     2K       -    33875  16,32,64,128,256
>>
>> should show memory allocated to the routing table.
> I was also shown (privately) this:
> 
> # vmstat -z | grep "rtentry"
> rtentry:                  120,        0,      198,      474,   
> 12190,        0
> 
> Either works for me, so I'm now happy. Thanks!

neither of these gives an exactly accurate answer,
In hte case of dangling routes, for example, routes can be outside the 
table and still not freed. (their reference counts have not gone to 0
as a socket still holds a reference for example).

it is however a good upper bound I guess

> 
> Myke
> 
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?493223B5.7080502>