Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jan Hugo Prins <jhp@jhprins.org>
Cc: netdev@vger.kernel.org
Subject: Re: Linux IPv6 router table size.
Date: Sun, 16 Jan 2011 09:44:22 +0100	[thread overview]
Message-ID: <1295167463.3977.33.camel@edumazet-laptop> (raw)
In-Reply-To: <4D320D90.3090005@jhprins.org>

Le samedi 15 janvier 2011 à 22:11 +0100, Jan Hugo Prins a écrit :
> Hi netdev kernel developers,
> 
> In the beginning of December the number of IPv6 routes in the BPG router
> tables got somewhere close to 4096 and this number is somewhat magical
> in Linux. Why is it magical? Well, the default setting for
> net.ipv6.route.max_size is hardcoded in the linux kernel to be exactly
> this number, this in contradiction with the IPv4 net.ipv4.route.max_size
> which is set based upon the size of your memory. Actually, in the IPv4
> part of the kernel sources their is a route.c with a nice formula
> telling the kernel how big this number should be. For IPv6 their is also
> a route.c with some nice formula in it, the formula says exactly the
> following:
> net->ipv6.sysctl.ip6_rt_max_size = 4096;
> 
> The result of all this magic was that when the BGP RIB in my quagga
> routers went over the 4096 routes, quagga started complaining that it
> couldn't put the routes in the kernel FIB anymore and this went all into
> syslog.
> 
> It took some digging to find the reason for these error messages, but
> after changing this sysctl to something more useful, everything was fine
> again.
> 
> Maybe it is a good idea to change this in the IPv6 tree to something
> more useful in the same direction of the solution that is in the IPv4 tree.
> 

Hi

IPv4 does an auto memsize tuning because it uses a hash table, and this
table cant be resized after boot.

IPv6 is different, and you can change 
/proc/sys/net/ipv6/route/gc_thresh & /proc/sys/net/ipv6/route/max_size
whithout downsides.

echo 32768 >/proc/sys/net/ipv6/route/max_size
echo 8192 >/proc/sys/net/ipv6/route/gc_thresh

(or equivalent lines in /etc/sysctl.conf)

We probably could change default values, but they are "not hardcoded" ;)




      reply	other threads:[~2011-01-16  8:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-15 21:11 Linux IPv6 router table size Jan Hugo Prins
2011-01-16  8:44 ` Eric Dumazet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1295167463.3977.33.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=jhp@jhprins.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox