* Limit the route hash size.
@ 2004-12-09 16:25 Robin Holt
0 siblings, 0 replies; only message in thread
From: Robin Holt @ 2004-12-09 16:25 UTC (permalink / raw)
To: netdev, linux-kernel
I got the following from the boot of one of our really large machines:
IP: routing cache hash table of 33554432 buckets, 524288Kbytes
I have done a lot of testing with the rt_hash_table. I would like to
propose that for the overwhelming majority of machines, the default size
is wrong.
It is currently based on numphyspages(). I would suggest that the
majority of machines will never need more than a single page of memory
for this hash. In my testing, I found a single 16k page would only get an
11% fill in a fairly heavily used production machine on a large network.
The only place where the large route cache seems to make sense is for
larger servers that are servicing internet connections from many sites.
Since the cache is completely flushed every 10 minutes by default, the
above machine would have to be adding 55,924 routes per second that were
ideally distrbuted throughout the hash space to even fill every bucket.
The patch I am proposing is as follows. For the sites that need larger
route hashes, they can use the rhash_entries command line option to set
it as desired.
Signed-off-by: Robin Holt <holt@sgi.com>
diff -Naur linux-orig/net/ipv4/route.c linux/net/ipv4/route.c
--- linux-orig/net/ipv4/route.c 2004-12-09 09:00:06 -06:00
+++ linux/net/ipv4/route.c 2004-12-09 08:56:33 -06:00
@@ -2728,7 +2728,7 @@
if (!ipv4_dst_ops.kmem_cachep)
panic("IP: failed to allocate ip_dst_cache\n");
- goal = num_physpages >> (26 - PAGE_SHIFT);
+ goal = 0;
if (rhash_entries)
goal = (rhash_entries * sizeof(struct rt_hash_bucket)) >> PAGE_SHIFT;
for (order = 0; (1UL << order) < goal; order++)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-12-09 16:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-09 16:25 Limit the route hash size Robin Holt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).