Date: Fri, 09 Nov 2012 01:39:13 +0400 From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> To: Andre Oppermann <oppermann@networx.ch> Cc: freebsd-net@FreeBSD.org Subject: Re: arp/ndp default hash size Message-ID: <509C2681.9020303@FreeBSD.org> In-Reply-To: <509B86D5.6090401@networx.ch> References: <509AE539.5050102@FreeBSD.org> <509B86D5.6090401@networx.ch>
next in thread | previous in thread | raw e-mail | index | archive | help
On 08.11.2012 14:17, Andre Oppermann wrote: > On 07.11.2012 23:48, Alexander V. Chernikov wrote: >> Hello list! >> >> Currently size of arp/ndp hash is the following: >> #define LLTBL_HASHTBL_SIZE 32 /* default 32 ? */ >> >> This may be OK for end hosts, but this is definitely not enough for >> router howadays. Especially >> given that IPv6 hosts generate 2 ndp records. >> >> Output from 2 random v4 / v6 routers from my $job: >> 2:23 [0] m@matisse arp -an | wc -l >> 1494 >> 2:24 [0] m@singapore ndp -an | wc -l >> 3999 >> >> Given that LIST_HEAD is just a pointer, and we currently have single >> global (actually per-VNET) >> instance for every l3 proto, bumping hash to, say, at least 4096 >> should do no harm. > > A small list per hash bucket isn't bad. The hash should be about 1/4 > of the expected table size. > > One problem here may be the memory consumption on smaller systems. A > very large hash table size may hurt and isn't needed for a few entries. I was afraid of proposing too small hash size. 4k costs 16kbytes which is not much nowadays :) > > For a compromise I'd say the default hash table size should be 256 or 512. For me, 512 seems to be quite good default for generic box. >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?509C2681.9020303>